ArticleDirectory
- Usage
- Principles and extension methods
- Additional instructions
Jef Raskin mentioned in the book The humance interface: New Directions for designing interactive systems that a good user interface should put the user's current object of interest (document) and the operation (command) that the user wants to apply to the object. As a result, Jef Raskin talked about several very avant-garde interface design concepts. One of them is that users can calculate or process selected content in real time during the editing process, and even execute the selected content as a command or script.
I am very interested in this design concept. This idea is a bit like what is mentioned in Lisp or similar FP programming.ProgramData consistency. There seems to be such real-time computing software on the Internet, but I can't remember where it is. I just want to do it myself, so I got the following little tool. Although this tool is rough (it is written in C language and has not been tested or optimized), it is quite interesting to run and can reflect the people-oriented idea of Jef Raskin to a certain extent.
If you are interested in this, you can download xeval and its source code at the following URL. If you have implemented better tools based on xeval, don't forget to let me know.
Http://www.contextfree.net/wangyg/c/xeval/xeval.html
The xeval documentation is as follows:
Xeval scalable real-time computing tool V1.0 usage
This is a simple and interesting little tool. Its design concept comes from the interface design technology introduced in the book The humance interface: New ctions for Designing Interactive Systems by Jef Raskin.
Install xeval.exe and run the xeval.exe program in the directory directly. After running xeval, you cannot see any exceptions except a small icon in the taskbar in the lower-right corner of the screen (right-click the icon to see the xeval menu ).
Now, when you input text in applications such as Word, PowerPoint, notepad, ultraedit, and Visual Studio, you can try to input a mathematical expression. For example, in the following word document, you suddenly want to calculate the increase in the company's per capita fee this year. It doesn't matter. You don't have to open a calculator, as long as you enter the expression you want to calculate in the Word document, use the mouse or keyboard to select this expression:
Press CTRL + ALT + F5 (this is the default hotkey defined by xeval for mathematical operations). You will find that this mathematical expression is replaced
This is the calculation result of the mathematical expression. Is it convenient? -- This is also the origin of the word "real-time.
Of course, the role of xeval is far more than that. Xeval is an extensible and generalized computing tool. You can add various functions for xeval by adding plug-ins, such as encryption and decryption for the text being edited, change the case sensitivity of letters, directly obtain the running results of a script language while editing the text, replace the entered abbreviations with pre-defined text, and perform simplified and traditional conversion for the text being edited, converts real-time metering units, and so on.
For example, when I write a PowerPoint document, I will write a schemeCode, Select it, as shown below:
Then, press the shortcut key and let xeval help me generate a series of standard Fibonacci (on my computer, I embedded the mzscheme interpreter in Plt scheme into xeval as a plug-in, therefore, the calculation result contains the copyright information of mzscheme, which I did not filter out ):
So as long as you think of it, you can simply develop a plug-in for xeval, or find a program prepared by someone else as a plug-in, you can make xeval more and more efficient.
Principles and extension methods
In fact, the implementation principle of xeval is very simple. Xeval registers a system-level shortcut key for each plug-in. When we select some text in other software such as Word and press the shortcut key, xeval automatically sends a simulated "Ctrl-c" key combination to the current software. Most standard Windows programs copy the selected text to the clipboard. Xeval immediately writes the content in the clipboard to the Temporary File Ext. In, and uses the following command to call the plug-in program (the greater than or less than the symbol plays the role of I/O redirection ):
Some-plug-in.exe <Ext. In> Ext. Out
Next, xeval reads the content of Ext. Out, writes it back to the clipboard, and then sends the simulated "Ctrl-V" key combination to the current software. This is simple, and there is no xuanjicang in it. (people pursuing perfection may use screen-based word extraction technologies like Kingsoft to implement more powerful real-time computing functions ).
Therefore, any executable program that uses stdin as the input and stdout as the output can become the xeval plug-in. You can write your own plug-ins (in any language, but the execution speed should not be too slow, or xeval will wait for a rush), or you can use the programs written by others. In fact, the default mathematical operation plug-in of xeval is changed from the mfcalc sample program in the bison manual. Xeval and the mathematical operation plug-inSource codeThey are all under the src directory. You can view, use, and modify them as needed.
The method for installing the plug-in is also very simple. You just need to copy the executable program to the ext directory, or to the directory indicated by the Environment Variable path, and then configure ext under the ext directory in the following format. CONF file:
######################################## ######################################## ####### Xeval plug-in configuration file ## the comment line starts, all others are configuration lines. There can be one or more configuration lines. The format of each configuration line is # (configuration lines that do not conform to the following format are ignored): # <executable program name>, <shortcut key definition> # Where, the EXE or com file corresponding to <executable program name> is either stored in the ext directory or in the directory specified by environment variable # path. This executable program should be a control # program that reads standard input and writes the results to standard output. <Shortcut key definition> is a string consisting of +, Ctrl, shift, ALT, F1-F10, 1-9, A-Z, such: # CTRL + ALT + P # When CTRL and ALT are pressed, press P key # Alt + Ctrl + Shift + F3 # To press Ctrl, shift, and ALT, ####################################### ######################################## ######## plug-in calc.exe, CTRL + ALT + F5 # Scheme language interpreter plug-in (if PLT scheme is installed and the execution path is configured, you can use this plug-in) # mzscheme, CTRL + ALT + F9
Additional instructions
finally, I developed xeval to practice the idea of user interface design described by Jef Raskin, it does not try to write strong and stable software (similar but more sophisticated software tools should be available on the Internet ). Therefore, I used some of the simplest coding techniques and did not perform more tests after coding. If you find that xeval has one problem or another, you can modify and debug the xeval source code on your own to achieve the best use effect.