- Основная идея X Windows
- Итак, повторим
- Что мы с этого имеем
- Чего нам это стоит
- Как это запускается
- Библиотеки, Motif, и война круглых и квадратных кнопок
- Конфигурирование X Windows
- Запуск X Windows
- Настройки пользовательского окружения X Windows
- Настройки window-manager'a
Для начала немного истории и общих мест. Представим, что нам нужно написать программу, которая будет работать в графическом режиме. Нам потребуется: опрашивать клавиатуру, снимать события и координаты мыши, рисовать на экране, ... Как это делалось на MS-DOSе? Очень просто. Пишем одну большую программу, в ней - все: и логика, и обработка событий, и слежение за перемещениями мыши, ну, а когда требуется что-то нарисовать, мы даем команду на запись в порты EGA контроллера, рисуем пиксель... Через год появляется контроллер VGA, еще через год SVGA 800x600, 16 цветов, вслед за ним UVGA 1024x768, 256 цветов, затем XGA 1280x1024, 16Мб цветов...
Основная идея X Windows.
Имеем две независимых программы. Одна умеет рисовать на графическом мониторе, и вообще, обслуживать все это железо. Она называется X-сервер. Вторая программа - называем ее клиент X Windows, рисовать физически не умеет. Зато она знает, что именно надо рисовать, и умеет командовать. Команды типа: "нарисовать прямоугольник", "провести линию", "открыть окно", "вывести символ в заданном фонте", "опросить координаты мыши", и т.п. передаются X-серверу, а тот их исполняет - рисует. Формат и спецификации этих команд опубликованы, стандартизованы, и широко известны. Все вместе они называются "Протокол X Windows".
Итак, повторим.
X-сервер. Программа, которая написана специально под конкретное физическое устройство (имеется в виду - монитор, графконтроллер, мышь и клавиатура), умеет на нем рисовать, и умеет понимать команды рисования по протоколу X Windows System.
X-клиент. Прикладная программа, обеспечивающая графический интерфейс с пользователем. Команды для рисования на экране передает X серверу по протоколу X Windows System.
X-терминал. Ящик (монитор, графконтроллер, мышь, клавиатура, ну и, естественно, процессор и оперативная память), на котором запущена программа X-сервер. X-терминалом может служить самая обыкновенная графическая Unix-рабочая станция, на которой X сервер выполняется, как одна из многих прикладных задач. Специализированный X-terminal - ящик, на котором запускается только X сервер, и ничего кроме. Можно использовать PC под MS-DOSом, на котором запущена DOSовская программа, реализующая X сервер.
Xlib - библиотека C-ишных функций, реализующих протокол X Windows System. С помощью этой библиотеки можно писать графические программы - X-клиенты.
Что мы с этого имеем.
Мы получаем универсальный GAPI - (Graphical Application Programming Interface) - средство программирования графических приложений. Пользовательские графические программы при этом полностью отвязаны от железа, от конкретного графконтроллера. О железе пусть беспокоится X-сервер.
Протокол X Windows умеет "ездить" по сети: например по TCP/IP, или по DEC-net. Поэтому Xсервер может крутиться на одной машине, а X-клиент - на другой. То есть, картинка рисуется на одной машине, а программа, которая ее обеспечивает - крутится на другой.
X-сервер способен обслуживать сразу много клиентов, причем всех - одновременно. На нашем графическом экране может быть открыто сразу много окон - каждое окно порождается его собственным X клиентом. Клиенты эти могут быть запущены и на нашей машине (к которой подключена графическая подсистема), и на удаленных машинах, соединенных с нами по сети.
Чего нам это стоит.
Понятно чего. Ресурсов. X Windows очень любит ресурсы - память, процессор, диск. Способен съесть их в неограниченных количествах. А еще ведь надо программировать. (К счастью, не всем надо). Кто видел, как выглядят программы для MS Windows или Mac, может представить себе внешний вид исходных текстов X-овой программы.
Как это запускается.
Пусть в нашей сети есть машина с графической подсистемой и X сервером, и сетевой адрес этой машины pcat107.foms.msk
на pcat107 нужно выполнить команду:
xhost + # разрешить X-овым программам с ЛЮБОЙ машины # рисовать на экране машины pcat107
Запускаем на нашем компьютере X-овую программу, так, чтобы ее окошко рисовалось на мониторе pcat107. Для этого на нашем компьютере нужно выполнить команду:
xterm -display pcat107:0.0 &
Библиотеки, Motif, и война круглых и квадратных кнопок.
Можно писать X-овые программы, используя библиотеку Xlib. Многие так и пишут, хотя это весьма тяжело - уж больно невысок уровень Xlib'а. В помощь программистам было создано несколько toolkit'ов - библиотек более высокого уровня, в которых реализованы различные widget'ы. Widget - непереводимый термин X Windows. Склеен из двух слов - Window и Gadget (приспособление), является графическим объектом с привязанными к нему свойствами и реакциями на действия пользователя. Примеры widgetow: "кнопка", "менюшка", "окошко с текстом", "линейка прокрутки",...
Известны следующие toolkit'ы:
Xaw
|
- Anthena Widgets. Очень черно-белый, очень плоский, весьма небогатый. Зато - бесплатный. Посмотрите, как выглядят программы xterm, xedit, xman. Они сделаны на Xaw. |
xview
|
- Набор библиотек и объектов, использованных в реализации набора пользовательских утилит Sun-овской версии X Windows - "Open Windows". Весьма симпатично. Круглые кнопки, "шприцы-иголки" (замечательная вещь!), очень хорошо продуманный интерфейс пользователя, в том числе активно используемая трех-кнопочная мышь. Исходные тексты библиотек xview открыты, предоставляются бесплатно. Однако набор DeskSet - 15 пользовательских утилит входящих в OpenWindows, сделанный на библиотеке xview, SunSoft готов предоставить только за плату. В бинарном виде - весьма дешево ($100). В исходных текстах - весьма дорого ($200K) |
Motif
|
- Библиотека поставляются организацией OSF за не совсем маленькую плату. Исходные тексты библиотек недоступны, либо чрезмерно дороги. Кнопки - квадратные, да и вообще Motif'овские приложения до безобразия напоминают MS Windows (что, IMHO, является серьезным преступлением) |
В борьбе BSD и Unix V победил, как известно, System V, а в войне круглых и квадратных кнопок выиграл Motif.
Конфигурирование X Windows
В Linux используется X11 в реализации XFree86. Чтобы его сконфигурировать, выполните команду xf86config
Запуск X Windows.
На некоторых машинах он сам запускается. А также иногда удается запустить его вручную командами: startx и/или openwin
Solaris:
Установите переменные окружения:
2. OPENWINHOME=/usr/openwin export OPENWINHOME3. LD_LIBRARY_PATH=/usr/openwin/lib export LD_LIBRARY_PATH4. PATH=/usr/openwin/bin:$PATH export PATH5. XAPPLERESDIR=/usr/openwin/lib/app-defaults export XAPPLERESDIR
Запустите X Windows командой
openwin
"Нормальные" Unix'ы:
Установите переменные окружения:
2. PATH=/usr/bin/X11:$PATH3. XAPPLERESDIR=/usr/lib/X11/app-defaults
Запустите X Windows командой
startx
"Ненормальные" Unix'ы (Unixware).
Когда регистрируете пользователя, ответьте Yes на вопрос "Хотите графический DeskTop". Тогда после login'а X Windows будет запускаться автоматически. Если вы прозевали, и ответили No, то никаким осмысленным способом запустить X Windows для себя вам не удастся.
Настройки пользовательского окружения X Windows
При наличии пользовательских настроечных файлов, лежащих в домашнем каталоге пользователя, используются они. Если их нет, используются стандартные, общественные, обычно лежащие в каталоге /usr/lib/X11 или /usr/openwin/lib
Персональные и общественные пользовательские настройки хранятся в файлах:
$HOME/.Xdefaults $HOME/.OWdefaults /usr/lib/X11/Xdefaults /usr/openwin/lib/Xdefaults /usr/openwin/lib/app-defaults/*
Окружение (desktop) - т.е. программы, которые стартуют автоматически при запуске X Windows находится в файлах:
Solaris:
$HOME/.openwin-init /usr/openwin/lib/openwin-init
"Нормальнные" X windows:
$HOME/.xinitrc /usr/lib/X11/xinit/xinitrc
Настройки window-manager'a
- т.е. - поведение окон, менюшки пользователя, раскладка команд на клавиши мышки, ...
Solaris:
$HOME/.openwin-menu $HOME/.openwin-menu-* /usr/openwin/lib/openwin-menu /usr/openwin/lib/openwin-menu-*
Linux
$HOME/.fvwmrc /usr/lib/X11/fvwm/system.fvwmrc
Другие работы по теме:
Уменьшение размера реестра
Всем известно, что сердце Windows находится в системном реестре. Правильность реестра - залог долговечности операционной системы Windows.
Основные понятия Windows
Text Graphics Объектами называют сущности, имеющие различные свойства. Объектами называют сущности, имеющие различные свойства. Graphics
Does Microsoft Have Too Much Power Essay
, Research Paper Does Microsoft Have Too Much Power? Initially, there is nothing. Then, there is Bill Gates the founder of Microsoft. Once a young, eager teenager running a small business of other
Madame Bovary Windows Essay Research Paper Windows
Madame Bovary: Windows Essay, Research Paper Windows frequently appear in the novel Madame Bovary. Emma is constantly peering out of windows. Windows are a symbol of hope and dreams, and also escape.
Linux Essay Research Paper Introduction TOPIC
Linux Essay, Research Paper Introduction ? TOPIC: Can Linux succeed in a Windows world? Linux is a Unix-language-based computer platform and is described as being slimmer, faster, more reliable
Should This Business Update To Windows 2000
From Windows 98 For Its Office Pcs? Essay, Research Paper Should this business update to Windows 2000 from Windows 98 for its office PCs? In the business world today, computers and the software applications that run on them basically control an well-organized business. Every major company is equipped with a computer, or network that connects through different branches throughout the firm.
Final Exam Essay Research Paper Beginning Windows
Final Exam Essay, Research Paper Beginning Windows ?98 Instructor: Zita Podany Final Exam 1. To format a high-density diskette to use on my PC, I would first click on ?My Computer?, (which is located on the desktop) and insert your diskette, then right click on ?3? floppy?. Go to format, then make sure ?Quick? or ?Full? are checked, then click on the ?start? button.
NT Model Essay Research Paper When Windows
NT Model Essay, Research Paper When Windows NT was developed the designers ensured that security features were built in unlike when for example when MS Dos was developed. By default NT
WAR And PEACE And How It Effected
The World Essay, Research Paper If your computer starts up in the 24 bit version of the game with fuzzy looking graphics, try re-selecting the screen mode from the F11 menu. This
Windows 95 Essay Research Paper Windows 95
Windows 95 Essay, Research Paper Windows 95 may very well be the most talked about software release in history. With more people than ever using personal computers, and given Microsoft’s dominance in this still growing market, Mr. Gates’ newest offering has caused quite a stir. As with any new product in this ultra-competitive industry, Windows 95 has come under intense scrutiny.
Comparing Operating Systems Essay Research Paper Comparing
Comparing Operating Systems Essay, Research Paper Comparing Microsoft Operating Systems : 95/98/NT This report is centered on the similarities and differences of the three major operating systems provided by Microsoft during the previous decade. There were and will always be changes and upgrades some of the information may not be current, as these systems have had certain upgrade modules that may not covered.
Get Informed!
! – Buying The Right Computer Essay, Research Paper Get Informed! – Buying The Right Computer Buying the right computer can be complicating. Because of this many
Cognitive Artifacts
& Windows 95 Essay, Research Paper Cognitive Artifacts & Windows 95 The article on Cognitive Artifacts by David A. Norman deals with the theories and principles of artifacts as they relate to the user during execution
Windows 30 Essay Research Paper Windows 30
Windows 3.0 Essay, Research Paper Windows 3.0 With window’s 3.0, you can unleash the power of your 286 or 386 computer’s protected mode. Unlike earlier releases that made you purchase separate versions
Computer Fundamentals Essay Research Paper The very
Computer Fundamentals Essay, Research Paper The very first operating system used on the earliest IBM PCs was called simply the Disk Operating System, abbreviated DOS. There are few PC users who have not heard of DOS; at one time it was used on pretty much every PC, and it is still around today in many different forms.
Microsoft Antitrust Court Case Essay Research Paper
As this paper is written there is a landmark court case proceeding in Washington in front of a federal judge. This case involves the charging of the Microsoft Corporation for violating antitrust laws set up by the government to preserve market competition. A general overview of the accusations brought against Microsoft by the Justice Department was given by Hayes in the Scholastic Update article The U.S. versus Microsoft (1999).
Microsoft Monopoly Essay Research Paper By now
Microsoft Monopoly Essay, Research Paper By now everyone is familiar with the case U.S. vs. Microsoft. What is all this about? According to my two articles, Microsoft, the world’s leading software company, is being sued by the Justice Department joined by 19 states.
Windows 95 Or NT Essay Research Paper
Windows 95 or NT When one asks himself or another, Which Operating system will better fill my needs as an operating system Windows 95 or Windows NT version 3.51. I will
OPERATING SYSTEMS DOS AND WINDOWS 95 Essay
, Research Paper REVIEW OF OPERATING SYSTEMS, DOS AND WINDOWS 95 1) It is necessary to install an operating system on every microcomputer because you need user interface.
Metric System Essay Research Paper Metric SystemThe
Metric System Essay, Research Paper Metric System The Metric System, also known as the System Internationale (SI) was developed in France in 1799. The Metric System was created because the French and English were not in agreement politically, therefore the French did not want anything to do with the English including their system of measurements.
Windows 95 The O S Of The Future
Essay, Research Paper Windows 95 the O/S of the Future The way of the computing world is changing at a neck breaking pace. People are looking for computers to be easy to use, and to make life easier for them. The
Computers In Business Essay Research Paper In
Computers In Business Essay, Research Paper In the business world today, computers and the software applications that run on them basically control a well organized business. Every major
Boot Process And Hardware Components Essay Research
Paper Observing the Boot Process and Hardware Components 1. Carefully watch your computer screen during the boot process (press Pause if necessary), and record which CPU is used by your home or lab computer?
Windows 98 Vs Windows Me Essay Research
Paper Microsoft has remained at the top of the personal computer industry. It is the bar that other companies in their field must measure up to. The strong hold Microsoft has established is due in great part to the strength and popularity of their operating systems. Over the past year Microsoft has released Windows 2000, a network based OS to replace older Windows NT systems.
Zero Effort Network Essay Research Paper Zero
Zero Effort Network Essay, Research Paper Zero Effort Networks (Z.E.N. works) is a great new tool in NetWare 5, that makes the network administrator’s job a lot easier by allowing him to spend less time
Plug And Play Essay Research Paper Plug
Plug And Play Essay, Research Paper Plug And Play Technological advances have swept our society into the twenty-first century. Many accessories have become easily compatible to take personal PC s to new heights. Windows 95 was the first operating system to offer the feature of plug and play. Adding new hardware to your computer is easier than ever because it is set up to communicate by means of an I/O address, interrupt request, and a direct memory access channel.
How To Maintain A Computer System Essay
, Research Paper How to Maintain A Computer System Start a notebook that includes information on your system. This notebook should be a single source of information about your entire system, both hardware
Windows 95 Beats Mac Essay Research Paper
Windows 95 Beats Mac Over the years, there has been much argument over which computer platform to buy. The two contenders in theis competions have been the PC , with its Windows
Untitled Essay Research Paper Battle of the
Untitled Essay, Research Paper Battle of the Bytes Macintosh vs. Windows 95 It used to be that the choice between a Mac and a PC was pretty clear. Ifyou wanted to go for the more expensive, easier to use, and better graphics andsound, you went to buy a Macintosh, for the cheaper price, it was the PC. Now itis a much different show.
Disaster Recovery Essay Research Paper Windows on
Disaster Recovery Essay, Research Paper Windows on Management – Disaster Recovery in the New Information Age This window talks about some of the benefits of a recovery system for businesses with round the clock electronic commerce. If a disaster happens and these companies don’t have a recovery system, it can cause massive delays and that can lead to loss of business and profits.
Home Computer Network Essay Research Paper Have
Home Computer Network Essay, Research Paper Have you ever needed to have more than one home computer for you and your family? Do you have two or more computers, but need to copy and/or share files and/or programs between them, but you don t know how? Do all of your computers need Internet access, but you don t want to have a phone line installed for each of them? Well, you can do all of this.
Lock Outs In Sql Server Essay Research
Paper Lock Outs in SQL Server If you lock yourself out of SQL Server without being able to log on with a sysadmin login, you don’t have to reinstall SQL Server. To access SQL Server, you need to use the registry key for SQL Server 2000 and SQL Server 7.0 that determines the authentication mode of SQL Server.