1. Field of the Invention:
The present invention relates generally to a method, apparatus, and computer usable code for documenting a program. More specifically the present invention relates to a method to couple text of at least one data structure with resultant images of the program.
2. Description of the Related Art:
Illustrations and program screen shots contain information that is valuable, but tend to be arranged in a variety of manners. Though a program may be the source for such graphical information, frequently the textual information is reduced to a form that is later captured as a bitmapped image. The bitmapped image, rather than storing text as individual characters, actually stores the text in a more complex and abstract form, a bit field. The bit field is merely an artistic rendition, employing fonts and colors of the shading, sizing, and other motifs of each character. Thus, the bit field contains far too much information for many purposes, and often the wrong kind of information, where an individual character would do just fine. By an individual character, it is meant a code point or computer encoded character such as produced using the American Standard Code for Information Interchange, better known as ASCII, standard well known in the art.
As a result, a number of methods have been employed to glean the ASCII characters from an image. One such method requires optical character recognition, a highly computer intensive operation. Another method involves a human operator hand keying the details of text from an image.
In addition to obtaining information for database purposes, the prior art also has provided a way for vision impaired people to collect text that otherwise would be displayed to a screen. Using this technology, a computer introspects a graphical object that otherwise would display something to a screen. Such an object is sometimes called a widget. Introspection is a cooperative process wherein a first program inspects and queries the data structures of a second program that displays material to a screen. The first program extracts text from the second program, the second program having one or more widgets.
The aspects of the present invention provide a computer implemented method, apparatus, and computer usable code for coupling text of a data structure with a resultant image of a program. A screen capture program introspects the data structure to obtain at least one text string. The screen capture program stores the text string to form a second data structure. The screen capture program associates a unique identifier with the second data structure. The screen capture program appends a bitmap of a window to the second data structure, wherein the bitmap is derived from the data structure.
In a preferred embodiment, portions of the bitmap image are associated with introspection results from graphical objects, which display within respective portions of the interface.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
With reference now to
In the depicted example, local area network (LAN) adapter 212, audio adapter 216, keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224, hard disk drive (HDD) 226, CD-ROM drive 230, universal serial bus (USB) ports and other communications ports 232, and PCI/PCIe devices 234 connect to south bridge and I/O controller hub 210 through bus 238. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash binary input/output system (BIOS).
Hard disk drive 226 and CD-ROM drive 230 connect to south bridge and I/O controller hub 204 through bus 240. Hard disk drive 226 and CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. Super I/O (SIO) device 236 may be connected to south bridge and I/O controller hub 204.
Thus, a platform for enabling the creation of a database of one or more containers is established. The database may provide a body of easily searched images. Consequently, the embodiments of the present invention relieves readers, searchers and translators from some of the chores and delays in finding the right image.
Screen capture program 303 identifies the top window of a graphical user interface. Alternatively, screen capture program 303 may identify a window that is not yet been captured. Screen capture program 303 identifies, for example, by issuing handle request 311 to operating system 301. Such a request facilitates screen capture program 303 to address queries to target application window 305. Target application window 305 is an example of a graphical user interface. Operating system 301 or target application window 305 may respond with handle 313, wherein screen capture program 303 receives handle 313. Handle 313 is an identifier unique to the application to which handle 313 references such that no two applications have the same handle on operating system 301.
After receiving handle 313, screen capture program 303 uses handle 313 to make at least one query 315 to target application window 305. Querying is a process wherein one program addresses a second program and passes one or more parameters to the second program for evaluation and retrieval of associated information accessible to the second program. Often such information is stored in objects of the second program.
A node is a place where information may be stored that may have parent relationships with one or more additional nodes. In addition, a node may have a parent-child relationship with a node. Screen capture program 303 of
A screen capture program may initially query a target application window and determine that the root widget contains the text string “Run”, and be associated with the object identifier “1”. Additional information may be stored, and consequently retrieved from the root widget, such as a coordinate. The screen capture program assembles this data at root node 551 of the tree data structure 550. In addition, information concerning the identity of child nodes to the root widget are retrieved from the root widget. The child nodes, which are widgets, in this instance, number five. Each of these widgets are queried in turn by screen capture program 303 of
Screen capture program calls the traverse function, or series of steps, by passing or otherwise messaging the most recently accessed window and node to a local environment or context. The context exists for the duration that the traverse function operates. Screen capture program creates the context during the call to the traverse function (step 705). Other program calls to the traverse function also create contexts applicable to both program calls. Multiple contexts may exist simultaneously, however, when an iteration of the traverse function ends, one of the contexts is no longer valid, and the screen capture program de-allocates memory formerly reserved for the context.
Screen capture program, in calling the traverse function, may provide among the parameters a parameter that may be either a window or a widget. Screen capture program determines if the window or widget is a container, that is, that the window or widget contains child nodes (step 755). A determination that the window or widget contains child nodes causes the screen capture program to get the number of child widgets or nodes of the present window or widget (step 757). An index may be set (step 759) in association with the current context. Screen capture program determines if the index is less than the number of widgets (step 761). An affirmative determination causes screen capture program to get a child widget (step 763). Then screen capture program adds a child node to the current node of the tree (step 765). Screen capture program calls the traverse function, passing the most recent node and widget (step 767). Like the call from main program to traverse function, screen capture program forms a separate environment or context for the node and widget passed.
A traverse function returns by two routes. First, a negative result may occur at step 755. Second, a negative result may occur when comparing the index to the number of child widgets at step 761. Each of these results leads to screen capture program determining if the traverse function was recursively called (step 790). An affirmative branch results in screen capture program returning parameters in the current context, and the context to switch to the context of the calling traverse function. The affirmative branch leads to an increment of the index (step 769). Screen capture program follows the increment step with the index test step 761.
A non-recursive call is what occurs when the steps in
Screen capture program assigns a unique identifier to the top window (step 709). Screen capture program saves the bitmap of the top window (step 713).
Access to the displayed contents of a target application makes use of accessibility functions available from the operating system or the graphical user interface window manager, otherwise known as assistive technologies. For example, Java provides accessibility functions through Swing components, a set of software objects that extract user interface text, for example, to assist people who have sight impairments and require specialty rendering apparatus for interacting with the computer. Operating systems such as Windows and integrated development environment such as Eclipse provide other software packages to access target application object information concerning displayed text of target windows.
Thus, a platform for enabling the creation of a database of one or more containers is established. The database may provide a collection of easily searched images, which may be rapidly searched.
Though Swing is widely available for use in Java supporting operating systems, traversing of objects may be performed using other functions to access the data stored in target application windows.
The various embodiments of the invention may enhance the ability to couple or pair the images or graphical outputs from a program with segments of text that were used in a graphical user interface to produce the various images. Such couplings may provide a searchable database, for example, applications that provide online help to new or confused users of the program.
The present invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the present invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the present invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk—read only memory (CD-ROM), compact disk—read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the present invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.