Chinaunix首页 | 论坛 | 博客
  • 博客访问: 174121
  • 博文数量: 96
  • 博客积分: 4060
  • 博客等级: 上校
  • 技术积分: 1040
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-12 13:13
文章分类

全部博文(96)

文章存档

2011年(3)

2010年(76)

2009年(17)

我的朋友

分类: LINUX

2010-05-06 16:13:46

    因為效率因素的考虑, 這些 property 的名稱和 type 以 atom 表示. 在 系 統, 每一個 atom 以一個整數(atom ID)表示, 代表著一個字串. 而且 每一個 atom 都是唯一的, 沒有任何兩個 atom 擁有 相同的 ID. 當我對 X Server 發出 request 而需要這些字串時為參數時, 我們就以對應的 atom ID 為參數, 這樣可以降 低字串在網路上傳輪的 overhead, 改進系統效率. Xlib 提供 一些 function, 讓我們在 atom 和字串之間轉 換. 當 client 導入一個新的 字串進入系統時, Xlib 也提供 function 以取得一個唯一,而且不重的 atom ID, 以對應 新加入的字串. 因此, 由 client 導入的字串, 在每一次 執行時, 不一定會得到同一個 atom ID. 但, 由系統內建 的 atom 則有固定 的 ID, 這些 atom 定義在 (XA_prefix 形式, 如 XA_WM_CLASS).這些 atom 可以 hard code 在程式碥, 不需再經過 Xlib 所提供的 function 加以轉換.


GTK里有 class,widget_class,widget 三种应用风格,每一种都有详细的分类,怎么应用将关系到整个主题细节的成败。

111111111111111111
widget_class "*.GtkButton.*" style "button-content"

Classpath

the window

GtkWindow

the button inside the window

GtkWidget.GtkButton

the label inside the button

GtkWidget.GtkButton.GtkLabel


222222222222222222222222
widget "my-app.my-button" style "my-app button fix"

33333333333333333333333333333
class "*" style "default"
class "GtkButton" style "button"

This will work great for normal buttons, but it does not work for toggle buttons. This is because GtkToggleButton matches against the "*" with a higher priority than it does against the "GtkButton" match. The styles are merged as following:


lowest


gtk

Priority of the buildin theme

application

dunno what this is for, if application use this they will be overriden by the theme.

theme

Default priority of themes

rc

gtkrc files set in the GTK2_RC_FILES enviroment variable and the standard files ~/.gtkrc-2.0 and /etc/gtk-2.0/gtkrc

highest


Engines

Hmm, I am not entirely happy with this section. While I think that there is not much it should cover, this feels like it is too little.

As said earlier, engines are used to define the look and extend the styles. For example to use the Clearlooks engine, you can just do the following.

style "some-style" {
engine "clearlooks" {
# engine specific settings go here
}
}

This means the Clearlooks engine will be used with its default settings. You can modify engine settings in the block. For a description of the possible options for different engines please refere to their documentation at .



阅读(375) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~