fbpx
维基百科

客户间通信协定手册

计算技术中,客户间通信协定手册(Inter-Client Communication Conventions Manual:缩写为ICCCMI39L即“I, 39个字母, L”)[1]X窗口系统的标准协议。它规定有一个共同的X服务器客户间的通信。它主要用于在窗口管理器和X服务器的其他客户之间的通信。

历史 编辑

它由MIT X联盟David S. H. Rosenthal英语David S. H. Rosenthal在1988年设计,其版本1.0发行于1989年7月而版本2.0发行于1994年早期。

背景 编辑

X刻意的规定窗口交互的“机制而非政策”。因此,客户互操作需要超出X协议自身的额外规定。

特征 编辑

ICCCM规定剪切和粘贴缓冲区,窗口管理器交互,会话任务管理,如何操纵共享资源和如何管理设备颜色。这些底层功能一般实现在部件工具箱桌面环境之内。这把应用编程者隔离于直接与ICCCM自身打交道,因为这些功能被委托给了实现工具箱。

批评 编辑

ICCCM声名狼藉于有歧义和难于正确实现[2]。进而有些部分被废除或不再实践上去实现[3]

针对目前需要而更新和澄清ICCCM的努力导致了扩展窗口管理器提示(EWMH),它获得了相当广泛接受并随着需要出现而被持续扩展。

窗口管理器的基本工作原理 编辑

下面以Nick Welch写的极小化的窗口管理器TinyWM[4]的源代码,展示窗口管理器的基本工作原理,它做四件基本工作:通过Alt+Button1(鼠标左键)拖动来交互式的移动(move)窗口,通过Alt+Button3(鼠标右键)拖动来交互式的调整大小(resize)窗口,通过Alt+F1来前置(raise)窗口,通过鼠标指针来聚焦(focus)窗口。

/* TinyWM is written by Nick Welch <mack@incise.org>, 2005.  *  * This software is in the public domain  * and is provided AS IS, with NO WARRANTY. */ #include <X11/Xlib.h> #define MAX(a, b) ((a) > (b) ? (a) : (b)) int main() {  Display * dpy;  Window root;  XWindowAttributes attr;  XButtonEvent start;  XEvent ev;  if(!(dpy = XOpenDisplay(0x0))) return 1;  root = DefaultRootWindow(dpy);  XGrabKey(dpy, XKeysymToKeycode(dpy, XStringToKeysym("F1")), Mod1Mask, root,  True, GrabModeAsync, GrabModeAsync);  XGrabButton(dpy, 1, Mod1Mask, root, True, ButtonPressMask, GrabModeAsync,  GrabModeAsync, None, None);  XGrabButton(dpy, 3, Mod1Mask, root, True, ButtonPressMask, GrabModeAsync,  GrabModeAsync, None, None);  for(;;)  {  XNextEvent(dpy, &ev);  if(ev.type == KeyPress && ev.xkey.subwindow != None)  XRaiseWindow(dpy, ev.xkey.subwindow);  else if(ev.type == ButtonPress && ev.xbutton.subwindow != None)  {  XGrabPointer(dpy, ev.xbutton.subwindow, True,  PointerMotionMask|ButtonReleaseMask, GrabModeAsync,  GrabModeAsync, None, None, CurrentTime);  XGetWindowAttributes(dpy, ev.xbutton.subwindow, &attr);  start = ev.xbutton;  }  else if(ev.type == MotionNotify)  {  int xdiff, ydiff;  while(XCheckTypedEvent(dpy, MotionNotify, &ev));  xdiff = ev.xbutton.x_root - start.x_root;  ydiff = ev.xbutton.y_root - start.y_root;  XMoveResizeWindow(dpy, ev.xmotion.window,  attr.x + (start.button==1 ? xdiff : 0),  attr.y + (start.button==1 ? ydiff : 0),  MAX(1, attr.width + (start.button==3 ? xdiff : 0)),  MAX(1, attr.height + (start.button==3 ? ydiff : 0)));  }  else if(ev.type == ButtonRelease)  XUngrabPointer(dpy, CurrentTime);  } } 

引用 编辑

  1. ^ The X-Windows Disaster (页面存档备份,存于互联网档案馆) Don Hopkins, UNIX-HATERS Handbook
  2. ^ ([//web.archive.org/web/20190617214524/https://raw.githubusercontent.com/kfish/xsel/1a1c5edf0dc129055f7764c666da2dd468df6016/rant.txt 页面存档备份,存于互联网档案馆) - [chat] Re: [SLUG] Ximian / Gnome and Xalf]
  3. ^ Re: ICCCM compliance?. [2019-11-16]. (原始内容于2019-11-16). 
  4. ^ TinyWM(页面存档备份,存于互联网档案馆

外部链接 编辑

  • Inter-Client Communication Conventions Manual, Version 2.0(页面存档备份,存于互联网档案馆
  • Inter-Client Communication Conventions Manual(页面存档备份,存于互联网档案馆) Version 2.0

客户间通信协定手册, 在计算技术中, inter, client, communication, conventions, manual, 缩写为icccm或i39l即, 39个字母, 是x窗口系统的标准协议, 它规定有一个共同的x服务器的客户间的通信, 它主要用于在窗口管理器和x服务器的其他客户之间的通信, 目录, 历史, 背景, 特征, 批评, 窗口管理器的基本工作原理, 引用, 外部链接历史, 编辑它由mit, x联盟的david, rosenthal, 英语, david, rosenthal, 在1988. 在计算技术中 客户间通信协定手册 Inter Client Communication Conventions Manual 缩写为ICCCM或I39L即 I 39个字母 L 1 是X窗口系统的标准协议 它规定有一个共同的X服务器的客户间的通信 它主要用于在窗口管理器和X服务器的其他客户之间的通信 目录 1 历史 2 背景 3 特征 4 批评 5 窗口管理器的基本工作原理 6 引用 7 外部链接历史 编辑它由MIT X联盟的David S H Rosenthal 英语 David S H Rosenthal 在1988年设计 其版本1 0发行于1989年7月而版本2 0发行于1994年早期 背景 编辑X刻意的规定窗口交互的 机制而非政策 因此 客户互操作需要超出X协议自身的额外规定 特征 编辑ICCCM规定剪切和粘贴缓冲区 窗口管理器交互 会话任务管理 如何操纵共享资源和如何管理设备颜色 这些底层功能一般实现在部件工具箱或桌面环境之内 这把应用编程者隔离于直接与ICCCM自身打交道 因为这些功能被委托给了实现工具箱 批评 编辑ICCCM声名狼藉于有歧义和难于正确实现 2 进而有些部分被废除或不再实践上去实现 3 针对目前需要而更新和澄清ICCCM的努力导致了扩展窗口管理器提示 EWMH 它获得了相当广泛接受并随着需要出现而被持续扩展 窗口管理器的基本工作原理 编辑下面以Nick Welch写的极小化的窗口管理器TinyWM 4 的源代码 展示窗口管理器的基本工作原理 它做四件基本工作 通过Alt Button1 鼠标左键 拖动来交互式的移动 move 窗口 通过Alt Button3 鼠标右键 拖动来交互式的调整大小 resize 窗口 通过Alt F1来前置 raise 窗口 通过鼠标指针来聚焦 focus 窗口 TinyWM is written by Nick Welch lt mack incise org gt 2005 This software is in the public domain and is provided AS IS with NO WARRANTY include lt X11 Xlib h gt define MAX a b a gt b a b int main Display dpy Window root XWindowAttributes attr XButtonEvent start XEvent ev if dpy XOpenDisplay 0x0 return 1 root DefaultRootWindow dpy XGrabKey dpy XKeysymToKeycode dpy XStringToKeysym F1 Mod1Mask root True GrabModeAsync GrabModeAsync XGrabButton dpy 1 Mod1Mask root True ButtonPressMask GrabModeAsync GrabModeAsync None None XGrabButton dpy 3 Mod1Mask root True ButtonPressMask GrabModeAsync GrabModeAsync None None for XNextEvent dpy amp ev if ev type KeyPress amp amp ev xkey subwindow None XRaiseWindow dpy ev xkey subwindow else if ev type ButtonPress amp amp ev xbutton subwindow None XGrabPointer dpy ev xbutton subwindow True PointerMotionMask ButtonReleaseMask GrabModeAsync GrabModeAsync None None CurrentTime XGetWindowAttributes dpy ev xbutton subwindow amp attr start ev xbutton else if ev type MotionNotify int xdiff ydiff while XCheckTypedEvent dpy MotionNotify amp ev xdiff ev xbutton x root start x root ydiff ev xbutton y root start y root XMoveResizeWindow dpy ev xmotion window attr x start button 1 xdiff 0 attr y start button 1 ydiff 0 MAX 1 attr width start button 3 xdiff 0 MAX 1 attr height start button 3 ydiff 0 else if ev type ButtonRelease XUngrabPointer dpy CurrentTime 引用 编辑 The X Windows Disaster 页面存档备份 存于互联网档案馆 Don Hopkins UNIX HATERS Handbook web archive org web 20190617214524 https raw githubusercontent com kfish xsel 1a1c5edf0dc129055f7764c666da2dd468df6016 rant txt 页面存档备份 存于互联网档案馆 chat Re SLUG Ximian Gnome and Xalf Re ICCCM compliance 2019 11 16 原始内容存档于2019 11 16 TinyWM 页面存档备份 存于互联网档案馆 外部链接 编辑Inter Client Communication Conventions Manual Version 2 0 页面存档备份 存于互联网档案馆 Inter Client Communication Conventions Manual 页面存档备份 存于互联网档案馆 Version 2 0 取自 https zh wikipedia org w index php title 客户间通信协定手册 amp oldid 73331045, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。