{"id":1065,"date":"2011-07-14T14:55:56","date_gmt":"2011-07-14T06:55:56","guid":{"rendered":"https:\/\/www.csslayer.tk\/wordpress\/?p=1065"},"modified":"2011-07-14T14:55:56","modified_gmt":"2011-07-14T06:55:56","slug":"why-fcitx-need-refactor","status":"publish","type":"post","link":"https:\/\/www.csslayer.info\/wordpress\/fcitx-dev\/why-fcitx-need-refactor\/","title":{"rendered":"Why fcitx need refactor?"},"content":{"rendered":"<p>\u9996\u5148\u8bf8\u541b\u6ca1\u5fc5\u8981\u7ed9Fcitx\u52a0\u4e0a\u5404\u79cd\u5b9a\u4e49\uff0c\u5b9a\u4e49\u662f\u4eba\u5b9a\u7684\u3002\u6700\u91cd\u8981\u7684\u5c31\u662f\u5f00\u53d1\u8005\u5b9a\u7684\u3002\u7136\u540e\u4e0d\u5e78\uff0c\u73b0\u5728\u8fd9\u4e2a\u4eba\u662f\u6211\u3002<\/p>\n<p>\u8f7b\u91cf\uff1f\u7b80\u6d01\uff1f\u5feb\u901f\uff1f\u8fd9\u5927\u6982\u662f\u591a\u6570\u4eba\u5bf9\u4e8efcitx\u7684\u770b\u6cd5\u3002<\/p>\n<p>\u6211\u5fc3\u4e2d\u7684\u7406\u60f3\u7684fcitx\u662f\u4ec0\u4e48\u6837\u7684\uff1f<\/p>\n<p>\u53ef\u7528\u6027\uff08Usability\uff09\uff0c\u539f\u751f\uff08Native\uff09\uff0cKISS\u3002<\/p>\n<p>\u7b2c\u4e00\u6761\uff0c\u5728\u8fd9\u65b9\u9762\u505a\u7684\u52aa\u529b\u53ef\u80fd\u6ce8\u610f\u4e0d\u5230\uff0c\u57283.6\u65f6\u4ee3\u56f0\u6270\u4e0d\u5c11\u4eba\u7684\u65b9\u5757\u5b57\u95ee\u9898\uff0c\u540e\u6765\u901a\u8fc7Fontconfig\u548cPango\uff08\u5982\u679c\u7981\u7528Pango\u5c31\u662fFontconfig\u627e\u5b57\u4f53\u4e86\uff09\u5f97\u5230\u4e86\u76f8\u5bf9\u6bd4\u8f83\u597d\u7684\u89e3\u51b3\u3002<\/p>\n<p>\u7b2c\u4e8c\u6761\uff0c\u8fd9\u5355\u7eaf\u662f\u4e2a\u4eba\u559c\u597d\uff0c\u4f3c\u4e4e\u4e5f\u662f\u5f88\u591alinux\u7528\u6237\u7684\u559c\u597d\u3002\u754c\u9762\u8981\u539f\u751f\u3002Fcitx\u7684\u754c\u9762\u539f\u751f\u5417\uff1f\u6ca1\u6709\u4f7f\u7528GTK\/Qt\uff0c\u8c08\u4e0d\u4e0a\u539f\u751f\uff0c\u4f46\u662f\u8fd9\u4e2a\u76ae\u80a4\u5f15\u64ce\u7ed9\u4e86Fcitx\u539f\u751f\u7684\u80fd\u529b\uff0c\u6bd4\u5982\u6211\u5c31\u66fe\u7ecf\u5199\u8fc7\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\uff0c\u4f7f\u7528KDE\u7684Plasma\u4e3b\u9898\u751f\u6210Fcitx\u7684\u76ae\u80a4\u3002<\/p>\n<p>\u5373\u4f7f\u5bf9\u4e8eGNOME\u6765\u8bf4\uff0c\u6211\u5176\u5b9e\u4e5f\u6ca1\u6709\u5fc5\u8981\u53bb\u5199\u4ec0\u4e48\u5229\u7528GNOME-Shell\u505a\u7684\u754c\u9762\uff0c\u4e0d\u8fc7\u4ed6<a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=633620\">\u90a3\u4e2abug<\/a>\u5982\u679c\u4e0d\u7ed9\u6211\u89e3\u51b3\u6389\uff08\u4e0d\u662f\u90a3\u4e2axim\u7684\uff0c\u662f\u5173\u4e8e\u754c\u9762\u663e\u793a\u7684\uff0c\u5176\u5b9e\u662f\u5f71\u54cd\u6240\u6709\u7a0b\u5e8f\u7684\u4e00\u4e2abug\uff09\uff0c\u90a3\u8fd8\u662f\u53ea\u80fd\u60b2\u5267\u3002<\/p>\n<p>\u7b2c\u4e09\u6761\uff0cFcitx\u7684\u67b6\u6784\u5176\u5b9e\u4e00\u76f4\u975e\u5e38\u7b80\u5355\uff0c\u4e00\u76f4\u4e5f\u6ca1\u6709\u5f15\u5165\u4ec0\u4e48\u66f4\u591a\u7684\u5916\u90e8\u4f9d\u8d56\uff08\u9664\u975e\u6709\u5fc5\u8981\uff09\uff0c\u73b0\u5728Fcitx\u9700\u8981\u53d1\u5c55\u7684\u8bdd\uff0c\u5176\u5b9e\u5c06\u4e0d\u5f97\u4e0d\u4f7f\u7528\u66f4\u591a\u4f9d\u8d56\uff0c\u4e0d\u8fc7\u4e0d\u7528\u62c5\u5fc3\uff0c\u8fd9\u4e9b\u4e0d\u4ec5\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u786e\u5b9a\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5728\u5b89\u88c5\u65f6\uff0c\u8fd0\u884c\u65f6\u786e\u5b9a\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u6211\u4e00\u76f4\u6267\u7740\u4e8e\u4e0d\u5f15\u5165\u9ad8\u7ea7\u5e93\u7684\u62bd\u8c61\uff1f\u9664\u4e86\u4e3a\u4e86\u6ee1\u8db3\u4e00\u4e9b\u4eba\u7684\u6d01\u7656\u4e4b\u5916\uff0c\u66f4\u91cd\u8981\u7684\u539f\u56e0\u5c31\u662f\u4fdd\u6301\u7b80\u5355\u3002\u5bf9\u4e8e\u5185\u90e8\u7684\u4e8b\u4ef6\u5904\u7406\uff0c\u867d\u7136\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u6bd4\u5982libevent\uff0c\u6216\u8005gio\uff0c\u6216\u8005\u522b\u7684\u4ec0\u4e48\uff0c\u4f46\u662f\u5b83\u76f8\u5bf9\u4e5f\u4e0d\u4f1a\u5e26\u6765\u4ec0\u4e48\u7528\u6237\u53ef\u89c1\u7684\u597d\u5904\u3002\uff08\u6700\u5f71\u54cdFcitx\u901f\u5ea6\u7684\u90e8\u5206\u662f\u8f93\u5165\u6cd5\u5f15\u64ce\uff0c\u7528sysprof\u6d4b\u5b9a\u8fc7\uff09\uff0c\u589e\u52a0\u6211\u7684\u5404\u79cd\u5b66\u4e60\u6210\u672c\u2026\u2026<\/p>\n<p>\u53e6\u5916\u4e5f\u5c31\u662f\u7559\u4e0b\u5404\u79cd\u4f59\u5730\uff0c\u5982\u679c\u6709\u4e00\u5929Fcitx\u8981\u505a\u66f4\u5927\u7684\u8de8\u5e73\u53f0\u52a8\u4f5c\uff0c\u90a3\u4e9b\u67d0\u4e2a\u5e73\u53f0\u4e0a\u6ca1\u6709\u7684\u5e93\u5e0c\u671b\u4e5f\u4e0d\u4f1a\u6210\u4e3a\u963b\u788d\u3002<\/p>\n<pre>$ ldd \/usr\/bin\/fcitx\r\nlinux-vdso.so.1 =&gt;\u00a0 (0x00007fff4e5ff000)\r\nlibfcitx-core.so.0.1 =&gt; \/usr\/lib\/libfcitx-core.so.0.1 (0x00007f8677546000)\r\nlibfcitx-config.so.4.1 =&gt; \/usr\/lib\/libfcitx-config.so.4.1 (0x00007f867733b000)\r\nlibfcitx-utils.so.0.1 =&gt; \/usr\/lib\/libfcitx-utils.so.0.1 (0x00007f86770fa000)\r\nlibpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x00007f8676edd000)\r\nlibc.so.6 =&gt; \/lib\/libc.so.6 (0x00007f8676b7c000)\r\nlibdl.so.2 =&gt; \/lib\/libdl.so.2 (0x00007f8676978000)\r\n\/lib\/ld-linux-x86-64.so.2 (0x00007f8677754000)<\/pre>\n<p>\u5176\u5b9eFcitx\u53d8\u5f97\u66f4\u8f7b\u4e86\u800c\u4e0d\u662f\u66f4\u91cd\u4e86\u3002<\/p>\n<p>\u987a\u4fbf\u8bf4\u70b9\u522b\u7684\uff08<del>\u867d\u7136\u6211\u60f3\u8bf4\u70b9Neta\u2026\u6bd4\u5982\u548cFcitx\u7b7e\u8ba2\u5951\u7ea6\u6210\u4e3a\u9b54\u6cd5\u5c11\u5973\u5427\uff01<\/del>\uff09<\/p>\n<p>\u6b22\u8fce\u6709\u5174\u8da3\u53c2\u4e0eFcitx\u5f00\u53d1\u7684\u4eba\u548cfcitx-dev@googlegroups.com\u8054\u7cfb\uff08\u6211\u5f88\u8ba8\u538c\u53ef\u4ee5\u5c06\u8054\u7cfb\u66f4\u52a0\u516c\u5f00\u7684\u65f6\u5019\u8054\u7cfb\u6211\u4e2a\u4eba\uff0c\u6240\u4ee5\u4e0d\u8981\u7ed9\u6211\u53d1\u4fe1\uff09\u3002\u81f3\u5c11\u73b0\u5728\u8fd8\u662f\u6709\u5f88\u591a\u4e8b\u60c5\u53ef\u4ee5\u505a\u7684\uff0c\u4e0d\u8fc7\u4f60\u6307\u671b\u6709\u4eba\u4ed8\u94b1\u90a3\u662f\u6ca1\u620f\u7684\u2026\u2026<\/p>\n<p>\u6bd4\u5982\u8bf4\uff1a<\/p>\n<p>fcitx-anthy\uff08\u6709\u4e2a\u6316\u4e86\u4e2a\u5751\u8fde\u6c34\u90fd\u6ca1\u586b\u7684\u5bb6\u4f19\u8bf4\u8981\u505a\u8fd9\u4e2a\uff0c\u6240\u4ee5\u4e0d\u5fc5\u4ecb\u610f\u4ed6\uff09<\/p>\n<p>fcitx-libpinyin\uff08\u4e00\u4e2a\u65b0pinyin\u5e93\uff0c\u4f3c\u4e4e\u6709\u5404\u79cd\u505a\u62fc\u97f3\u7684\u4eba\u53c2\u4e0e\uff09<\/p>\n<p>kimpanel\u7684GNOME-Shell\u7248\u672c\uff08\u8fd9\u4e2a\u5176\u5b9e\u548cfcitx\u6ca1\u76f4\u63a5\u8054\u7cfb\uff0c\u4e0d\u8fc7\u6709\u4e86\u8fd9\u4e2afcitx\u5728GNOME-Shell\u4e0b\u7684\u663e\u793a\u95ee\u9898\u5c31\u53ef\u4ee5\u89e3\u51b3\u4e86\uff09<\/p>\n<p>fcitx-{&#8230;}\uff0c\u4f60\u8fd8\u80fd\u60f3\u5230\u7684\u5176\u4ed6\u529f\u80fd\u3002\u6bd4\u5982m17n\u2026\u6216\u8005MAC OS\u79fb\u690d\u7b49\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u8bf8\u541b\u6ca1\u5fc5\u8981\u7ed9Fcitx\u52a0\u4e0a\u5404\u79cd\u5b9a\u4e49\uff0c\u5b9a\u4e49\u662f\u4eba\u5b9a\u7684\u3002\u6700\u91cd\u8981\u7684\u5c31\u662f\u5f00\u53d1\u8005\u5b9a\u7684\u3002\u7136\u540e\u4e0d\u5e78\uff0c\u73b0\u5728\u8fd9\u4e2a\u4eba\u662f\u6211\u3002 \u8f7b\u91cf\uff1f\u7b80\u6d01\uff1f\u5feb\u901f\uff1f\u8fd9\u5927\u6982\u662f\u591a\u6570\u4eba\u5bf9\u4e8efcitx\u7684\u770b\u6cd5\u3002 \u6211\u5fc3\u4e2d\u7684\u7406\u60f3\u7684fcitx\u662f\u4ec0\u4e48\u6837\u7684\uff1f \u53ef\u7528\u6027\uff08Usability\uff09\uff0c\u539f\u751f\uff08Native\uff09\uff0cKISS\u3002 \u7b2c\u4e00\u6761\uff0c\u5728\u8fd9\u65b9\u9762\u505a\u7684\u52aa\u529b\u53ef\u80fd\u6ce8\u610f\u4e0d\u5230\uff0c\u57283.6\u65f6\u4ee3\u56f0\u6270\u4e0d\u5c11\u4eba\u7684\u65b9\u5757\u5b57\u95ee\u9898\uff0c\u540e\u6765\u901a\u8fc7Fontconfig\u548cPango\uff08\u5982\u679c\u7981\u7528Pango\u5c31\u662fFontconfig\u627e\u5b57\u4f53\u4e86\uff09\u5f97\u5230\u4e86\u76f8\u5bf9\u6bd4\u8f83\u597d\u7684\u89e3\u51b3\u3002 \u7b2c\u4e8c\u6761\uff0c\u8fd9\u5355\u7eaf\u662f\u4e2a\u4eba\u559c\u597d\uff0c\u4f3c\u4e4e\u4e5f\u662f\u5f88\u591alinux\u7528\u6237\u7684\u559c\u597d\u3002\u754c\u9762\u8981\u539f\u751f\u3002Fcitx\u7684\u754c\u9762\u539f\u751f\u5417\uff1f\u6ca1\u6709\u4f7f\u7528GTK\/Qt\uff0c\u8c08\u4e0d\u4e0a\u539f\u751f\uff0c\u4f46\u662f\u8fd9\u4e2a\u76ae\u80a4\u5f15\u64ce\u7ed9\u4e86Fcitx\u539f\u751f\u7684\u80fd\u529b\uff0c\u6bd4\u5982\u6211\u5c31\u66fe\u7ecf\u5199\u8fc7\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\uff0c\u4f7f\u7528KDE\u7684Plasma\u4e3b\u9898\u751f\u6210Fcitx\u7684\u76ae\u80a4\u3002 \u5373\u4f7f\u5bf9\u4e8eGNOME\u6765\u8bf4\uff0c\u6211\u5176\u5b9e\u4e5f\u6ca1\u6709\u5fc5\u8981\u53bb\u5199\u4ec0\u4e48\u5229\u7528GNOME-Shell\u505a\u7684\u754c\u9762\uff0c\u4e0d\u8fc7\u4ed6\u90a3\u4e2abug\u5982\u679c\u4e0d\u7ed9\u6211\u89e3\u51b3\u6389\uff08\u4e0d\u662f\u90a3\u4e2axim\u7684\uff0c\u662f\u5173\u4e8e\u754c\u9762\u663e\u793a\u7684\uff0c\u5176\u5b9e\u662f\u5f71\u54cd\u6240\u6709\u7a0b\u5e8f\u7684\u4e00\u4e2abug\uff09\uff0c\u90a3\u8fd8\u662f\u53ea\u80fd\u60b2\u5267\u3002 \u7b2c\u4e09\u6761\uff0cFcitx\u7684\u67b6\u6784\u5176\u5b9e\u4e00\u76f4\u975e\u5e38\u7b80\u5355\uff0c\u4e00\u76f4\u4e5f\u6ca1\u6709\u5f15\u5165\u4ec0\u4e48\u66f4\u591a\u7684\u5916\u90e8\u4f9d\u8d56\uff08\u9664\u975e\u6709\u5fc5\u8981\uff09\uff0c\u73b0\u5728Fcitx\u9700\u8981\u53d1\u5c55\u7684\u8bdd\uff0c\u5176\u5b9e\u5c06\u4e0d\u5f97\u4e0d\u4f7f\u7528\u66f4\u591a\u4f9d\u8d56\uff0c\u4e0d\u8fc7\u4e0d\u7528\u62c5\u5fc3\uff0c\u8fd9\u4e9b\u4e0d\u4ec5\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u786e\u5b9a\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5728\u5b89\u88c5\u65f6\uff0c\u8fd0\u884c\u65f6\u786e\u5b9a\u3002 \u4e3a\u4ec0\u4e48\u6211\u4e00\u76f4\u6267\u7740\u4e8e\u4e0d\u5f15\u5165\u9ad8\u7ea7\u5e93\u7684\u62bd\u8c61\uff1f\u9664\u4e86\u4e3a\u4e86\u6ee1\u8db3\u4e00\u4e9b\u4eba\u7684\u6d01\u7656\u4e4b\u5916\uff0c\u66f4\u91cd\u8981\u7684\u539f\u56e0\u5c31\u662f\u4fdd\u6301\u7b80\u5355\u3002\u5bf9\u4e8e\u5185\u90e8\u7684\u4e8b\u4ef6\u5904\u7406\uff0c\u867d\u7136\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u6bd4\u5982libevent\uff0c\u6216\u8005gio\uff0c\u6216\u8005\u522b\u7684\u4ec0\u4e48\uff0c\u4f46\u662f\u5b83\u76f8\u5bf9\u4e5f\u4e0d\u4f1a\u5e26\u6765\u4ec0\u4e48\u7528\u6237\u53ef\u89c1\u7684\u597d\u5904\u3002\uff08\u6700\u5f71\u54cdFcitx\u901f\u5ea6\u7684\u90e8\u5206\u662f\u8f93\u5165\u6cd5\u5f15\u64ce\uff0c\u7528sysprof\u6d4b\u5b9a\u8fc7\uff09\uff0c\u589e\u52a0\u6211\u7684\u5404\u79cd\u5b66\u4e60\u6210\u672c\u2026\u2026 \u53e6\u5916\u4e5f\u5c31\u662f\u7559\u4e0b\u5404\u79cd\u4f59\u5730\uff0c\u5982\u679c\u6709\u4e00\u5929Fcitx\u8981\u505a\u66f4\u5927\u7684\u8de8\u5e73\u53f0\u52a8\u4f5c\uff0c\u90a3\u4e9b\u67d0\u4e2a\u5e73\u53f0\u4e0a\u6ca1\u6709\u7684\u5e93\u5e0c\u671b\u4e5f\u4e0d\u4f1a\u6210\u4e3a\u963b\u788d\u3002 $ ldd \/usr\/bin\/fcitx linux-vdso.so.1 =&gt;\u00a0 (0x00007fff4e5ff000) libfcitx-core.so.0.1 =&gt; \/usr\/lib\/libfcitx-core.so.0.1 (0x00007f8677546000) libfcitx-config.so.4.1 =&gt; \/usr\/lib\/libfcitx-config.so.4.1 (0x00007f867733b000) libfcitx-utils.so.0.1 =&gt; \/usr\/lib\/libfcitx-utils.so.0.1 (0x00007f86770fa000) libpthread.so.0 =&gt; \/lib\/libpthread.so.0 (0x00007f8676edd000) libc.so.6 =&gt; \/lib\/libc.so.6 (0x00007f8676b7c000) libdl.so.2 =&gt; \/lib\/libdl.so.2 (0x00007f8676978000) &hellip; <a href=\"https:\/\/www.csslayer.info\/wordpress\/fcitx-dev\/why-fcitx-need-refactor\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-fcitx-dev"],"_links":{"self":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":4,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1079,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1079"}],"wp:attachment":[{"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.csslayer.info\/wordpress\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}