﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-博览C++</title><link>http://www.cppblog.com/smarthill/</link><description>专注C++与软件设计技术</description><language>zh-cn</language><lastBuildDate>Sat, 18 Apr 2026 13:47:32 GMT</lastBuildDate><pubDate>Sat, 18 Apr 2026 13:47:32 GMT</pubDate><ttl>60</ttl><item><title>Cairo学习笔记</title><link>http://www.cppblog.com/smarthill/archive/2008/11/23/67681.html</link><dc:creator>Hill</dc:creator><author>Hill</author><pubDate>Sun, 23 Nov 2008 12:18:00 GMT</pubDate><guid>http://www.cppblog.com/smarthill/archive/2008/11/23/67681.html</guid><wfw:comment>http://www.cppblog.com/smarthill/comments/67681.html</wfw:comment><comments>http://www.cppblog.com/smarthill/archive/2008/11/23/67681.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/smarthill/comments/commentRss/67681.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/smarthill/services/trackbacks/67681.html</trackback:ping><description><![CDATA[<p><a href="http://www.cairographics.org/">Cairo</a>是一个支持多种输出设备的２Ｄ图形库。当前支持的输出目标（output target）包括：X Window System，Quartz，Win32，image buffers，PostScript，PDF，还有 SVG。</p> <p>下面研究一下Cairo的绘图模型，首先是该模型中最重要的三个概念：这三个概念对应于下图中的三层从上到下分别为：source，mask，destination。简单的思想就是Source会通过Mask的过滤从而画在我们的输出设备（destination）上。</p> <p>source是用来绘图的绘图板，或者笔，墨水，绘图的时候可以用来画线，填充。Source可以有以下四种：Colors，Gradients，Patterns和Images。</p> <p><a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_2.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="147" alt="image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_thumb.png" width="195" border="0"></a>&nbsp;<a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_4.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="149" alt="image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_thumb_1.png" width="189" border="0"></a><a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_6.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="149" alt="image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/Cairo_13803/image_thumb_2.png" width="199" border="0"></a></p> <p>最下面的destination，是一种surface，是要输出的设备，可以是窗口，或者一个PDF,SVG等等。因此我们要做的是使用“动词”构造一个合适的Mask。</p> <p>Mask被用作一个过滤器。Mask用来决定Source的哪些部分可以应用到destination上，哪些不可以用到destination上。</p> <p>所有的这三层会对应于一个Context。Context里面包含所有图形的状态数据（比如：线的宽度，颜色，surface to draw，还有其它，这就允许绘图函数使用少量的参数来绘图）。Mask层上不透明的部分可以应用到destination上，透明的地方刚不会。</p> <p>这些“动词”包括：Stroke和Fill。Stroke允许path附近的source通过mask。而fill允许path内部的元素通过mask。（The stroke operation draws the outlines of shapes and the fill operation fills the insides of shapes.）另外的动词还包括Paint，Mask和ShowText等。</p> <p>&nbsp;</p> <p>更多请参考这里：<a title="http://www.cairographics.org/tutorial/" href="http://www.cairographics.org/tutorial/">http://www.cairographics.org/tutorial/</a></p><img src ="http://www.cppblog.com/smarthill/aggbug/67681.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/smarthill/" target="_blank">Hill</a> 2008-11-23 20:18 <a href="http://www.cppblog.com/smarthill/archive/2008/11/23/67681.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用Eclipse CDT对Ｃ＋＋进行重构</title><link>http://www.cppblog.com/smarthill/archive/2008/11/22/67544.html</link><dc:creator>Hill</dc:creator><author>Hill</author><pubDate>Fri, 21 Nov 2008 16:29:00 GMT</pubDate><guid>http://www.cppblog.com/smarthill/archive/2008/11/22/67544.html</guid><wfw:comment>http://www.cppblog.com/smarthill/comments/67544.html</wfw:comment><comments>http://www.cppblog.com/smarthill/archive/2008/11/22/67544.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/smarthill/comments/commentRss/67544.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/smarthill/services/trackbacks/67544.html</trackback:ping><description><![CDATA[<p>一年前用ＣＤＴ时还发现其经常会失反应，时至今日又试用了一下，发现已有很大改善。并且在其官网上可以下载到，专门为Ｃ＋＋程序员而打包的Eclipse，这样我们就不用再自己去配置插件了：）。虽然Eclipse有些笨重，但是相对安装一下就要近半个小时的ＶＳ而言，已然轻便多了。</p> <p>ＣＤＴ的重构主要由以下几个功能，相对对ＪＡＶＡ的支持，差远了。这可能是由于Ｃ＋＋本身的复杂性引起的。</p> <ol> <ol> <ol> <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Rename  <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Extract Constant  <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Extract Function  <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hide Method（这个我还末试用）  <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Implement Method（这个是可以实现类的头文件里声明的函数，好像与继承无关。。）  <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Generate Getter and Setter（这个功能对Ｃ＋＋啥用吧：），并且实现的也有点傻） </li></ol></ol></ol> <p>&nbsp;</p> <p><a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/EclipseCDT_64C/image_2.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/EclipseCDT_64C/image_thumb.png" width="509" border="0"></a> </p> <p>&nbsp;</p> <p><a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/EclipseCDT_64C/image_6.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="398" alt="image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/EclipseCDT_64C/image_thumb_2.png" width="515" border="0"></a></p><img src ="http://www.cppblog.com/smarthill/aggbug/67544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/smarthill/" target="_blank">Hill</a> 2008-11-22 00:29 <a href="http://www.cppblog.com/smarthill/archive/2008/11/22/67544.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员应该掌握的知识结构</title><link>http://www.cppblog.com/smarthill/archive/2008/11/21/67538.html</link><dc:creator>Hill</dc:creator><author>Hill</author><pubDate>Fri, 21 Nov 2008 15:58:00 GMT</pubDate><guid>http://www.cppblog.com/smarthill/archive/2008/11/21/67538.html</guid><wfw:comment>http://www.cppblog.com/smarthill/comments/67538.html</wfw:comment><comments>http://www.cppblog.com/smarthill/archive/2008/11/21/67538.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cppblog.com/smarthill/comments/commentRss/67538.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/smarthill/services/trackbacks/67538.html</trackback:ping><description><![CDATA[<p>我一直认为程序员要掌握的知识分为两个部分：一种是语言相关，一种是系统相关。所谓语言相关，便是编程语言的相关语法知识，类库的使用，另外就是与系统平台相关的。对于一些运行于虚拟机或平台上的语言而言，好像就是去掌握类库了。</p> <p><a href="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/ea9651e8a4de_150F9/New%20Bitmap%20Image.png"><img title="New Bitmap Image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="324" alt="New Bitmap Image" src="http://www.cppblog.com/images/cppblog_com/smarthill/WindowsLiveWriter/ea9651e8a4de_150F9/New%20Bitmap%20Image_thumb.png" width="572" border="0"></a> </p> <p>有时候会迷茫于不知道学习什么，所以画上上面这个图，希望在迷路的时候可以有向可循。</p><img src ="http://www.cppblog.com/smarthill/aggbug/67538.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/smarthill/" target="_blank">Hill</a> 2008-11-21 23:58 <a href="http://www.cppblog.com/smarthill/archive/2008/11/21/67538.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>实现抽象工厂的两种方法</title><link>http://www.cppblog.com/smarthill/archive/2008/11/15/67008.html</link><dc:creator>Hill</dc:creator><author>Hill</author><pubDate>Sat, 15 Nov 2008 10:32:00 GMT</pubDate><guid>http://www.cppblog.com/smarthill/archive/2008/11/15/67008.html</guid><wfw:comment>http://www.cppblog.com/smarthill/comments/67008.html</wfw:comment><comments>http://www.cppblog.com/smarthill/archive/2008/11/15/67008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/smarthill/comments/commentRss/67008.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/smarthill/services/trackbacks/67008.html</trackback:ping><description><![CDATA[<p>在设计模式中提到：“AbstractFactory类通常用FactoryMethod实现，但也可以用Prototype实现。”</p> <p>代码请看这里：</p> <p><a title="http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af.cpp" href="http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af.cpp">http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af.cpp</a></p> <p><a title="http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af2.cpp" href="http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af2.cpp">http://code.google.com/p/tcplex/source/browse/trunk/Design_Pattern/af2.cpp</a></p><img src ="http://www.cppblog.com/smarthill/aggbug/67008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/smarthill/" target="_blank">Hill</a> 2008-11-15 18:32 <a href="http://www.cppblog.com/smarthill/archive/2008/11/15/67008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>