Portland ÊǸöеĿªÔ´ÏîÄ¿£¬Ëü³ÐŵҪ°ïÖú Linux® Ó¦ÓóÌÐòÔÚ¶àÖÖ×ÀÃæ»·¾³ÖÐÔËÐУ¬°üÀ¨ Gnome ºÍ
KDE£¬´Ó¶ø¼ò»¯ Linux® Ó¦ÓóÌÐòµÄ²¿ÊðºÍÉÌÒµ»¯¡£ËäÈ»¸Ã¼¼ÊõÈÔºÜÄêÇᣬµ«ÏÖÔÚÒѾ¿ÉÒÔʹÓà Portland
ÁË£¬²¢ÇÒËü¿´ÉÏÈ¥ÕýÔÚ²»¶Ï¿ìËٸĽø¡£ÏÖÔÚ¿ªÊ¼Ê¹Óà Portland 1.0 ÖÐµÄ XdgUtils ¹¤¾ß¼¯¡£ ÔÚ¹¹½¨×ÀÃæ Linux Ó¦ÓóÌÐòµÄ¿ª·¢¼Æ»®Ê±£¬¿ÉÄÜÐèÒªÊʵ±¿¼Âǵ½µ×Õë¶ÔÄĸö×ÀÃæ »·¾³£¨DE£©½øÐпª·¢¡£
Gnome »¹ÊÇ KDE£¿µ±È»¿ÉÄÜ»¹ÓÐÆäËûµÄ×ÀÃæ¡£
µ«ÊÇÈç¹ûÖ»¿¼ÂÇÒ»ÖÖ×ÀÃæ»·¾³£¬ÄÇôӦÓóÌÐòµÄÏúÊÛ¿ÉÄܲ»»á³¤¾Ã£¬ÒÔ Portland ÏîÄ¿ ΪÀý¡£
Portland 씀Ê×ÏȽéÉÜһЩ±³¾°ÖªÊ¶¡£Portland ÏîÄ¿ÊÇΪÁ˽â¾öһЩÄÕÈ˵ÄÎÊÌ⣬ÕâЩÎÊÌ⽫ÔÚÈí¼þ¿ª·¢ÈËÔ±±àдÒ×ÓÚ
ÒÆÖ²µ½ËùÓÐ Linux ·¢ÐаüÖдò°üµÄ¸÷ÖÖ×ÀÃæ»·¾³£¨DE£©Ê±ÖÆÔìÂé·³¡£¾ßÌåÀ´Ëµ£¬Portland µÄÄ¿±êÊÇÌṩ
Ò»Ì׿ª·¢ÈËÔ±¿É±àдµÄͨÓà API£¬´Ó¶øʹӦÓóÌÐòÎÞÐ迼ÂÇ×ÀÃæ»·¾³¡£
¸ÃÏîÄ¿µÚÒ»¸öÒ²ÊÇĿǰʵÏֵĽ׶ΠPortland 1.0£¬ÃûΪ XdgUtils£¬ËüÊÇһЩʵÓóÌÐòµÄÀ¦°ó£¬Ó¦ÓóÌÐò
¿ÉÒÔÓÃËüÔÚÏÖÓеÄ×ÀÃæ»·¾³ÉÏÔËÐС£µÚ¶þ¸ö½×¶Î Portland 2.0 µÄ¼Æ»®°üº¬»ùÓÚ D-Bus ½Ó¿ÚµÄÃæÏò·þÎñµÄ
½ø³Ì¼äͨÐÅ»úÖÆ¡£
ËäÈ» XFCE¡¢GNUStep ºÍ MacOS X Ò²ÔÚδÀ´µÄ¿¼ÂÇÖ®ÖУ¬µ« Portland Ä¿Ç°Ö»Ö§³Ö KDE ºÍ Gnome¡£
ÔÚ±¾ÎÄÖУ¬½«¿ªÊ¼Ê¹Óà Portland µÄ XdgUtils ²¿·Ö£¬»¹½«Á˽â Portland µÄÉè¼ÆÈçºÎ·´Ó³Æä¸ü¹ã·ºµÄÄ¿
񈭜
Çë¿´Çåµ¥ 1£¬ËüÏÔʾÁË xdg-email ʵÓóÌÐòµÄÓ÷¨£º
Çåµ¥ 1. xdg-email µÄʾÀýÓ÷¨ # This invocation is valid for all desktop # environments and any e-mail client a user # may prefer. xdg-email --cc $COLLEAGUE --bcc $SELF \ --subject "Problem report" \ --body "This is a semi-automated fault report. You can edit this e-mail before sending it. Note that the problem log is automatically attached." \ --attach $LOG errors@$OUR_HOME
¿´µ½ÆäÖз¢ÉúµÄ±ä»¯ÁËÂð£¿ÕâÒ»¸öÃüÁî¾ÍÌæ´úÁËΪÊÊÓ¦ÖîÈç Firefox¡¢elm¡¢/bin/mail¡¢Opera µÈµÈÖÚ¶à
µç×ÓÓʼþ¿Í»§»ú¶øÐèҪʵÏÖµÄÊýÒ³½Å±¾¡£
ΪÁ˸üÈÝÒ×Àí½âºÍÈ«ÃæÓ¦ÓÃÕâÀàÃüÁÕâÀï½éÉÜһЩ±³¾°£º×ÀÃæ»·¾³°üº¬ ´°¿Ú¹ÜÀíÆ÷¡¢Í¼±ê¡¢¹¤¾ßÀ¸¡¢Ó¦
ÓóÌÐò¡¢Ç½Ö½¡¢¹¦ÄÜ£¨°üÀ¨ÍÏ·Å£©ºÍ¹¹³É×ÀÃæ¼ÆËã»úÓû§¼´Ê±ÌåÑéµÄ¶ÀÌØÍâ¹ÛºÍ¸ÐÊÜ¡£³£¼ûµÄ×ÀÃæ»·¾³ÓÐ
Gnome¡¢KDE¡¢XPde¡¢ALDE¡¢Xfce ¼°ÆäËû¡£ÄúÏ£ÍûÄúµÄ³ÌÐòÔÚ×Ô¼ººÍ¿Í»§»òͬÊÂʹÓõÄ×ÀÃæ»·¾³ÉÏ¿´ÆðÀ´ºÜ
¡°×ÔÈ»¡±£¬¶øÇÒÔË×÷Á¼ºÃ£º¼ôÇкÍÕ³ÌùÓ¦µ±Á¢¼´·¢Éú£¬ÑÕÉ«µ÷É«°å²»»áË𻵿ͻ§µÄÆÁÄ»£¬Ó¦ÓóÌÐòµÄÕýÈ·
°²×°Ó¦µ±ÏÔʾÔÚ×ÀÃæÓ¦ÓóÌÐòÑ¡Ôñ²Ëµ¥ÖкÏÀíµÄλÖá£
Ò»Ö±µ½×î½ü£¬ÊµÏÖÕâЩĿ±êµÄ¿É¿¿·½Ê½»¹ÊÇʹÓúÍÊìϤÌض¨×ÀÃæ»·¾³µÄ¹æ·¶ ¡ª¡ª ÀýÈç KDE ¡ª¡ª È»ºóÇë
½Ìר¼Ò»òÕßÖØÐÂѧϰÿһÖÖÆäËû×ÀÃæ»·¾³ÒªÇóµÄ¹æ·¶¡£ÔÚÕâ¸ö¼¶±ðÉÏ£¬ÖصãºÜÉÙÊÇʵÏÖÌØÊâµÄ¹¦ÄÜ»òÕßÓÃ
¸´Ôӵķ½Ê½ÒÆÖ²Ó¦ÓóÌÐò£»ÔÔòÉϽ²£¬ÕýÈ·°²×°µÄ Linux Ó¦ÓóÌÐòÓ¦¸ÃÄÜÓÃÈκÎ×ÀÃæ»·¾³µÄ´°¿Ú¹ÜÀíÆ÷ÏÔ
ʾ¡£Ö»Óа²×°Öиü¾«Ï¸µÄϸÔò£¬°üÀ¨±ØÒªµÄ¿âµÄλÖÃÒÔ¼°Ò»Ð©½ÏСµÄͼÐÎÐÞÊΣ¬²Å»áÇø±ð²»Í¬µÄ×ÀÃæ»·¾³
¡£
µ«ÊÇ£¬Èç¹û²»Ö»ÊÇΪ×Ô¼ººÍÉÙÊý³ÌÐòÔ±¿ª·¢Ó¦ÓóÌÐò£¬¶øÊÇÒª¿ª·¢¹ã·º·¢ÐеÄÉÌÒµ²úÆ·£¬ÄÇôÕýÈ·Á˽âÕâ
Щϸ½ÚÊDZØÐèµÄ¡£Çë×¢Ò⣬ÎÒûÓÐÑо¿×îÖÕÓû§½«¿´µ½µÄÉú¶¯µÄÏÔʾЧ¹û£ºPortland ²¢²»½â¾ö GUI Ö÷Ìâ
µÄ ¡°»¨ÇΡ±£¬»òÕßÒõӰЧ¹ûÓÖ»òÕßÐéÄâÎļþϵͳ´´Ð¡£Portland Ö»ÊÇ°ïÖú¿ª·¢ÈËÔ±µÄ´úÂëÔÚ½øÐа²×°ºÍ
²¿Êð×Ô¶¯ »¯Ê±£¬³ÊÏÖ¸üºÏÀíµÄ½çÃæ¡£
Çåµ¥ 1 ÏÔʾÁËÒ»¸öµäÐ͵ÄÏÖʵʾÀý£¬¸ø³öÁËÒ»¸ö×îÖÕÓû§Äܹ»ÔÚÆäËùÑ¡µÄµç×ÓÓʼþ¿Í»§»úÖбàдµÄµç×ÓÓÊ
¼þÏûÏ¢¡£Portland ¶¨ÒåÁË xdg-email ÃüÁËü¹ÜÀíÕâÀàÈÎÎñÖаüº¬µÄËùÓг£¼ûÌ×·¡£µ÷ÓÃÕâÑùµÄÃüÁîÐÐ
»áÆô¶¯Óû§µÄµç×ÓÓʼþ¿Í»§»ú£¬Ìî³äËüµÄÔªËØ£¨ÀýÈçÁÐ±í¡¢¸½¼þµÈ£©£¬²¢°Ñ¿ØÖÆȨתÒƸø×îÖÕÓû§¡£Ó¦ÓÃ
³ÌÐòÐèÒªÕâÖÖ°ïÖúÂð£¿Èç¹ûÐèÒª£¬ÄÇô Portland ÕýÊÇΪÄú×¼±¸µÄ¡£
Portland ³õ̽
È¥Ä꣬Portland ʵÓóÌÐò²Å¿ªÊ¼ÃæÏò¹«ÖÚ£¬µ«ÊDz»Òª¾ÚÉ¥£ºÕâ¸öÏîÄ¿ÕýÔÚ²»¶ÏµØʵÏÖËüµÄÄ¿±ê£¬¼´Ê¹ÊÇÏÖ
Óеİ汾£¬Ò²·Ç³£ÓÐÓᣲ»¹ýËüÈÔȻȱÉÙÏêϸµÄ½Ì³ÌºÍÆäËûµÄһЩ±ê×¼¹æ·¶¡£
Òª¿ªÊ¼Ê¹Óà Portland£¬ÇëÓÃÄäÃû CVS »ñµÃÔ´´úÂ룺
cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/portland \ co portland/xdg-utils
ÕâÑù¾ÍÏÂÔØÁËÒ»×éÃüÁîÐй¤×÷ XdgUtils£¬»¹Óгõ²½²âÊԼƻ®¡¢ ²âÊÔÌ×¼þµÄ¿ªÍ·²¿·Ö¡¢»ù±¾µÄ°²×°³ÌÐò¡¢
HTML »¯µÄÊÖ²áºÍÉÙÁ¿¹ÜÀíÎļþ¡£ÎĵµºÍÆäËûÓÅ»¯×îºó»á°üº¬ÔÚÆäÖС£ Portland »¹¼¯ºÏÁ˳ÆΪ ×ÀÃæ API
£¨DAPI£©µÄ C °ó¶¨¡£ ÏÂÒ»½Ú½«»á¿´µ½ DAPI¡£
XdgUtils °üº¬µÄ¹¤¾ßÄܹ»Íê³ÉÏÂÃæµÄ¹¦ÄÜ£º
°²×°ºÍжÔØ×ÀÃæͼ±ê¡¢Í¼±ê×ÊÔ´ºÍ²Ëµ¥Ïî ʹÓÃÓû§Ï²»¶µÄ±à¼Æ÷»òÓʼþÓû§´úÀí±àдµç×ÓÓʼþ ²éѯºÍ¹ÜÀíÎļþÀàÐÍ£¨.gif¡¢.c µÈ£©ºÍËüÃǵÄÃèÊö ʹÓÃÓû§Ñ¡ÔñµÄºÏÊʵÄÓ¦ÓóÌÐò´ò¿ªÎļþ»ò URL£¨Èç Windows® µÄ start ÃüÁîÐлò Mac OS X µÄ open£© ¿ØÖÆÆÁÄ»±£»¤³ÌÐò ʹÓÃÒ»ÖºͰ²È«µÄ·½Ê½Ôö¼Ó³ÌÐòȨÏÞ Ê¹ÓÃÈκÎÓïÑÔ»ò¿ª·¢»·¾³µÄ¿ª·¢ÈËÔ±Ó¦µ±¶¼ÄÜ·ÃÎÊÕâЩ¹¤¾ß£»¿ÉÒÔʹÓñà³Ì·½Ê½µ÷ÓÃËüÃÇ£¬ÈçͬʹÓÃ
shell ÖеÄÆäËûÃüÁîÒ»Ñù¡£ÀýÈ磬Èç¹ûÕýÔÚʹÓà Python£¬ÄÇô¿ÉÒÔÔÚ bash ´úÂë±àдµÄ°²×°½Å±¾ÖÐʹÓÃ
XdgUtils ¹¤¾ß£¬Ò²¿ÉÒÔʹÓÃϵͳµ÷Ó㬾ÍÏñÏÂÃæÕâÑù£º
os.system("xdg-open %s" % chosen_URL)
»òÕߣ¬Ò²¿ÉÒÔʹÓà Python µÄÈκÎÆäËûº¯Êý¸ü¾«Ï¸µØ¿ØÖÆÍⲿ½ø³Ì¡£
Õ§¿´Ö®Ï£¬Portland µÄÄ¿±êºÜÆÕͨ¡£ËüÖ»ÊÇÓÃÒ»Öµķ½Ê½°ü×°ÁËÏÖÓеŦÄÜ ¡ª¡ª ͼ±êµÄ°²×°¡¢ÆÁÄ»±£»¤
³ÌÐòµÄ¹ÜÀí£¬ËùÒÔ¿ª·¢ÈËÔ±²»±ØΪÿ¸öеÄÓ¦ÓóÌÐò»òҪʹÓõÄ×ÀÃæ»·¾³ÖØд´½¨ËùÓлù±¾ÄÚÈÝ¡£¶øÇÒʵ
ÏÖ¸ÃÄ¿±êµÄ´ú¼Û·Ç³£Ð¡£º Portland µÄ¿ªÔ´Ðí¿ÉʹµÃʹÓà Portland ÎÞÐè½ðÇ®ÉϵĿªÖ§£¬Æä¼òµ¥ÐÔʵÏÖÁË
Ö»»¨·ÑºÜÉÙµÄʱ¼ä¾Í¿ÉÏÂÔØ¡¢°²×°ºÍʹÓà Portland¡£½áÂÛºÜÃ÷ÏÔ£ººÜСµÄͶ×ʾ͵õ½ÁËÈ·ÇжøÏÔÖøµÄ»Ø±¨
¡£ËùÒÔÕâÊǸöºÜÈÝÒ××ö³öµÄÑ¡Ôñ¡£
¹â»ÔµÄÇ°¾°
Èç¹ûÏàÐÅ Portland ´ÓÏÖÔÚ¿ªÊ¼»¹»á¼ÌÐø·¢Õ¹ÏÂÈ¥£¬ÄÇô¾ÍºÜÈÝÒ××ö³öÑ¡ÔñÁË¡£¶ÔÓÚ³õʼ·¢Ðа棬¶àÊý¹¤
×÷·ÅÔÚÁË»ùÓÚ Linux µÄ Gnome ºÍ KDE£¬¶øÇÒ Xfce Ò²µÃµ½ÁË Waldo Bastian Ëù³ÆµÄ ¡°¼«´ó¹Ø×¢¡±£¬
Waldo Bastian ÊÇ Intel ¹«Ë¾ Linux ¿Í»§»ú¼Ü¹¹Ê¦£¬Ò»ÃûÖ÷ÒªµÄ Portland ¹±Ï×Õß¡£µ± Portland »ñµÃ
ÆäÊ״γɹ¦Ó¦ÓÃÖ®ºó£¬ºÜ×ÔÈ»»áÔ¤²âµ½Ëü»áÀ©Õ¹µ½¸ü¶à×ÀÃæ»·¾³£¬ÉõÖÁÀ©Õ¹µ½ÆäËû²Ù×÷ϵͳ£¬ÀýÈç
Solaris »ò FreeBSD¡£ËüµÄÃüÁîÐÐʵÏÖµ±È»¿ÉÒÔÈÃËüÀ©Õ¹µ½ÐÂÁìÓò¡£´Ó¿ª·¢¾ÀíµÄ½Ç¶ÈÀ´¿´£¬ÎҺܸßÐËΪ
Portland ½çÃæ±àд´úÂë¡£Èç¹ûÎҵĿͻ§ÐèÒªÒÆÖ²µ½ Portland »¹²»Ö§³ÖµÄ×ÀÃæ»·¾³£¬¶ÔÎÒÃÇÀ´Ëµ£¬ÊµÏÖÒ»
¸öÕýÈ·µÄ Portland À©Õ¹²»»á±È°ÑÎÒÃÇ×Ô¼ºµÄ´úÂëÓ¦Óõ½²»Ö§³ÖµÄ×ÀÃæ»·¾³ÉϸüÄÑ¡£
¶øÇÒÇé¿öÓ¦µ±Ö»»áËæ×Åʱ¼ä¶ø¸ÄÉÆ¡£Èç¹ûµ±Ç°ÊµÏÖÏñÎÒÆÚ´ýµÄÄÇÑùÁ÷ÐУ¬ÄÇô³§ÉÌ£¬°üÀ¨·¢Ðдò°üÉÌ£¬¶¼
»áÓÐÐËȤά»¤ºÍ¸üРPortland£¬ÓÈÆä»áʹÓÃÌض¨ÓÚ²Ù×÷ϵͳµÄ·½Ê½À´ÊÊÓ¦ËüÃÇ¡£Í¬Ê±£¬Portland ÍŶӱ£
Ö¤²»»áÐ޸ıà³Ì½Ó¿Ú¡£Intel µÄ Tom Whipple ×¼±¸µÄ²âÊÔÌ×¼þÓ¦µ±ÓÐÖúÓÚ±£Ö¤ÕâÖÖÎȶ¨ÐÔ¡£
ΧÈÆ Portland Óм¸¸ö¹«¿ªµÄÎÊÌâ¡£´ò°ü±ê×¼Õâ¸öÎÊÌâÈÔÈ»ÐèÒªÐÉÌ¡£Portland µÄÉè¼ÆÕßÃǺÜÃ÷ÖǵضÔËû
Ãǵļܹ¹Éè¼Æ½øÐÐ×î´ó³Ì¶ÈµØ½âñĿǰÀ´Ëµ£¬´ò°üÎÊÌâÒѾ±»¸ôÀ룬ÉõÖÁ»¹²»ÖªµÀ×îÖյĽâ¾ö·½°¸»áÊÇ
·ñÊÇ Portland¡¢Linux Standard Base£¨LSB£©»òÆäËû¹¤×÷µÄÒ»²¿·Ö¡£Ä¿Ç°£¬Portland ÈÔÖ»¾ÖÏÞÔÚ±à³Ì·Ã
ÎʵäÐÍ´°¿Ú¹ÜÀíÆ÷µÄͼ±êºÍÆäËû×é¼þ¡£Ò»µ©·¢²¼ÁË KDE 4£¬±à³Ì½Ó¿Ú¿ÉÄÜ»áÀ©Õ¹µ½°üº¬Í¼±êÃüÃûºÍ¹²ÏíµÄ
MIME Êý¾Ý¿â¹æ·¶¡£
Çë¼Çס£¬Èç¹ûÔ¸Ò⣬¿ÉÒÔÓóÆΪ DAPI µÄ C °ó¶¨½øÐд°¿Ú¹ÜÀíÆ÷¼¶±ðµÄ½ø³Ì¼ä·ÃÎÊ¡£¾¡¹Ü XdgUtils ¸ü¼Ó
³ÉÊ죬»¹¿ÉÒÔ´ÓÏîÄ¿µÄ CVS ¿âÖлñµÃ DAPI µÄÔçÆÚ·¢Ðа棺
cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/portland \ co portland/dapi
ÓÐЧµÄ DAPI ±àÂë¿ÉÒÔÊÇÄ£¿é»¯µÄ£¬Ò²¿ÉÒÔÊÇÃæÏòʼþµÄ¡£ÃæÏòʼþµÄÇé¿öÏ£¬Ó¦ÓóÌÐòÁ¬½Óµ½ DAPI£¬È»
ºóÓà select() ·½·¨ÕìÌý»î¶¯¡£Ä£¿é»¯µ÷ÓõÄʾÀýÊÇÇåµ¥ 2 Öдò¿ª×ÊÔ´µÄº¯Êý£¨¶Ô·¢ÐаæÎĵµÖеĺ¯ÊýÉÔ
΢×öÁËÐ޸ģ©¡£
Çåµ¥ 2. ´ò¿ª URL µÄ DAPI C ´úÂëʾÀý /* Initialize with dapi_connectAndInit(). */ static DapiConnection* my_dapi_connection;
int openURL(const char *url) { /* DAPI wants to know about toplevel_widget so it can properly handle focus, layering, ... */ if (dapi_OpenUrl_window(my_dapi_connection, url, XWINDOW_HANDLE(toplevel_widget))) return 1; /* Handle failure here ... */ }
½áÊøÓï
Èç¹ûÓ¦ÓóÌÐò£¬ÌرðÊÇÓ¦ÓóÌÐòµÄ°²×°³ÌÐò£¬Ö±½Ó´¦Àí×ÀÃæ»·¾³£¬ÄÇô Portland ÄÜÌṩһÖÖʵÏÖÏàͬ¹¦
ÄܵĸüºÃ;¾¶¡£Ö»Òª¶ÔÔ´´úÂë×ö×îÉÙµÄÐ޸ģ¬ÒÔ¼°×îÉÙµÄÐí¿ÉÓ°Ïì»ò×îÉٵıà³ÌÀ§ÄÑ£¬²¢ÇÒ²»»áÎþÉüÈκÎ
¹¦ÄÜ£¬¾ÍÄܹ»Ê¹Óà Portland£¬»ñµÃ¶àÓÚ×Ô¼ºËùÄÜÊý±¶µÄÒÆÖ²ÐÔ¡£¶øÇÒ´Ó´Ë»¹ÄÜÀûÓÃδÀ´ Portland ¾ß±¸µÄ
ÈκÎÔöÇ¿ºÍÀ©Õ¹¡£
ÔÎÄÁ´½Ó£ºhttp://www.ibm.com/developerworks/cn/linux/l-portland.html
|