Docs on the theme format Themes are in a simple XML-subset format. Foo Foo P. Bar whoever, 2002 Jan 31 2005 A sentence about the theme. <!-- include another draw ops list; has optional x/y/width/height attrs --> <include name="some_other_draw_ops"/> <!-- tile another draw ops list; has optional x/y/width/height/tile_xoffset/tile_yoffset --> <tile name="some_other_draw_ops" tile_width="10" tile_height="10"/> </draw_ops> <frame_style name="normal" geometry="normal"> <!-- How to draw each piece of the frame. For each piece, a draw_ops can be given inline or referenced by name. If a piece is omitted, then nothing will be drawn for that piece. For each piece, the "width" and "height" variables in coordinate expressions refers to the dimensions of the piece, the origin is at the top left of the piece. So <rectangle x="0" y="0" width="width-1" height="height-1"/> will outline a piece. --> <piece position="entire_background" draw_ops="demo_all_ops"/> <piece position="left_titlebar_edge"> <draw_ops> <line color="#00FF00" x1="0" y1="0" x2="0" y2="height"/> </draw_ops> </piece> <!-- The complete list of frame pieces: entire_background: whole frame titlebar: entire area above the app's window titlebar_middle: area of titlebar_background not considered part of an edge left_titlebar_edge: left side of titlebar background right_titlebar_edge: right side of titlebar background top_titlebar_edge: top side of titlebar background bottom_titlebar_edge: bottom side of titlebar background title: the title area (doesn't include buttons) left_edge: left edge of the frame right_edge: right edge of the frame bottom_edge: bottom edge of the frame overlay: same area as entire_background, but drawn after drawing all sub-pieces instead of before --> <!-- For buttons, drawing methods have to be provided for each of three states: normal, pressed, prelight and the button function or position must be provided: close, maximize, minimize, menu, left_left_background, left_middle_background, left_right_background, right_left_background, right_middle_background, right_right_background So a working theme needs 3*4 = 12 button declarations and a theme may have up to 3*10 = 30 button declarations in order to handle button-rearrangement preferences. (The name "function" for the attribute is from before the background values existed.) --> <button function="close" state="normal" draw_ops="previously_named"/> <button function="menu" state="normal"> <draw_ops> <icon alpha="0.7" x="0" y="0" width="object_width" height="object_height"/> </draw_ops> </button> </frame_style> <!-- styles can inherit from each other with the parent="" attribute. In a subclass anything can be re-specified to override the parent style. --> <frame_style name="focused" parent="normal"> <piece position="title"> <draw_ops> <rectangle color="gtk:bg[SELECTED]" x="0" y="0" width="width-1" height="height-1"/> <title color="gtk:fg[SELECTED]" x="(width - title_width) / 2" y="(height - title_height) / 2"/> </draw_ops> </piece> </frame_style> <!-- Maps styles to states of frame. Focus: yes (focused), no (not focused) Window states: normal, maximized, shaded, maximized_and_shaded Window resizability: none, vertical, horizontal, both Everything unspecified just does the same as unfocused/normal/both. only state="normal" needs a resize="" attribute. --> <frame_style_set name="normal"> <frame focus="yes" state="normal" resize="both" style="focused"/> <frame focus="no" state="normal" resize="both" style="normal"/> </frame_style_set> <!-- Each window type needs a style set Types: normal, dialog, modal_dialog, menu, utility, border --> <window type="normal" style_set="normal"/> <!-- For menu icons, drawing methods are needed for the same four types as the buttons, and GTK states (insensitive,prelight,normal,etc.) --> <menu_icon function="close" state="normal" draw_ops="previously_named"/> </metacity_theme>