diff --git a/Makefile b/Makefile index 1ad8b30d..6b0c821c 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ INSTALL_LOCALE_HELPER ?= 0 TESTS = \ ${GOPKG_PREFIX}/adjust-grub-theme \ ${GOPKG_PREFIX}/blurimage \ - ${GOPKG_PREFIX}/cursor-helper \ ${GOPKG_PREFIX}/dde-open \ ${GOPKG_PREFIX}/deepin-shutdown-sound \ ${GOPKG_PREFIX}/device \ @@ -38,30 +37,10 @@ TESTS = \ ${GOPKG_PREFIX}/session \ ${GOPKG_PREFIX}/sound-theme-player \ ${GOPKG_PREFIX}/soundutils \ - ${GOPKG_PREFIX}/theme_thumb \ - ${GOPKG_PREFIX}/theme_thumb/common \ - ${GOPKG_PREFIX}/theme_thumb/cursor \ - ${GOPKG_PREFIX}/theme_thumb/gtk \ - ${GOPKG_PREFIX}/theme_thumb/icon \ - ${GOPKG_PREFIX}/themes \ - ${GOPKG_PREFIX}/themes/scanner \ - ${GOPKG_PREFIX}/thumbnailer \ - ${GOPKG_PREFIX}/thumbnails \ - ${GOPKG_PREFIX}/thumbnails/cursor \ - ${GOPKG_PREFIX}/thumbnails/font \ - ${GOPKG_PREFIX}/thumbnails/gtk \ - ${GOPKG_PREFIX}/thumbnails/icon \ - ${GOPKG_PREFIX}/thumbnails/images \ - ${GOPKG_PREFIX}/thumbnails/loader \ - ${GOPKG_PREFIX}/thumbnails/pdf \ - ${GOPKG_PREFIX}/thumbnails/text \ ${GOPKG_PREFIX}/userenv \ ${GOPKG_PREFIX}/validator LIBRARIES = \ - thumbnails \ - themes \ - theme_thumb\ dxinput \ drandr \ soundutils \ @@ -83,9 +62,7 @@ BINARIES = \ device \ graphic \ locale-helper \ - thumbnailer \ hans2pinyin \ - cursor-helper \ gtk-thumbnailer \ sound-theme-player \ deepin-shutdown-sound \ diff --git a/cursor-helper/cursor_helper_test.go b/cursor-helper/cursor_helper_test.go deleted file mode 100644 index f3fba9c5..00000000 --- a/cursor-helper/cursor_helper_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package main - -import ( - "fmt" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/linuxdeepin/dde-api/themes" -) - -func Test_setTheme(t *testing.T) { - cursorTheme := themes.GetCursorTheme() - tests := []struct { - Input string - Expected error - }{ - { - cursorTheme, - nil, - }, - { - "fake1Theme", - fmt.Errorf("invalid theme '%s'", "fake1Theme"), - }, - { - "fake2Theme", - fmt.Errorf("invalid theme '%s'", "fake2Theme"), - }, - } - for i, test := range tests { - t.Run("Test_setTheme"+strconv.Itoa(i), func(t *testing.T) { - assert.Equal(t, test.Expected, setTheme(test.Input)) - }) - } -} diff --git a/cursor-helper/exported_methods_auto.go b/cursor-helper/exported_methods_auto.go deleted file mode 100644 index 521b45e5..00000000 --- a/cursor-helper/exported_methods_auto.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by "dbusutil-gen em -type Manager"; DO NOT EDIT. - -package main - -import ( - "github.com/linuxdeepin/go-lib/dbusutil" -) - -func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods { - return dbusutil.ExportedMethods{ - { - Name: "Set", - Fn: v.Set, - InArgs: []string{"name"}, - }, - } -} diff --git a/cursor-helper/main.go b/cursor-helper/main.go deleted file mode 100644 index cb44b7d7..00000000 --- a/cursor-helper/main.go +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package main - -import ( - "fmt" - "os" - "strings" - "sync" - "time" - - "github.com/godbus/dbus/v5" - "github.com/linuxdeepin/dde-api/themes" - "github.com/linuxdeepin/go-lib/dbusutil" - "github.com/linuxdeepin/go-lib/log" -) - -//go:generate dbusutil-gen em -type Manager - -type Manager struct { - service *dbusutil.Service - runningMu sync.Mutex - running bool - setThemeMu sync.Mutex -} - -func (*Manager) GetInterfaceName() string { - return dbusInterface -} - -const ( - dbusServiceName = "org.deepin.dde.CursorHelper1" - dbusPath = "/org/deepin/dde/CursorHelper1" - dbusInterface = "org.deepin.dde.CursorHelper1" -) - -var logger = log.NewLogger("api/cursor-helper") - -func (m *Manager) Set(name string) *dbus.Error { - m.service.DelayAutoQuit() - - m.runningMu.Lock() - m.running = true - m.runningMu.Unlock() - - go func() { - m.setThemeMu.Lock() - err := setTheme(name) - if err != nil { - logger.Warning(err) - } - m.setThemeMu.Unlock() - - m.runningMu.Lock() - m.running = false - m.runningMu.Unlock() - }() - return nil -} - -func main() { - var name string - if len(os.Args) == 2 { - tmp := strings.ToLower(os.Args[1]) - if tmp == "-h" || tmp == "--help" { - fmt.Println("Usage: cursor-theme-helper ") - return - } - name = os.Args[1] - } - - if name != "" { - setTheme(name) - return - } - - // start DBus service - service, err := dbusutil.NewSessionService() - if err != nil { - logger.Fatal("failed to new session service", err) - } - - hasOwner, err := service.NameHasOwner(dbusServiceName) - if err != nil { - logger.Fatal("failed to call NameHasOwner:", err) - } - if hasOwner { - logger.Fatalf("name %q already has the owner", dbusServiceName) - } - - m := &Manager{ - service: service, - } - err = service.Export(dbusPath, m) - if err != nil { - logger.Fatal("failed to export:", err) - } - err = service.RequestName(dbusServiceName) - if err != nil { - logger.Fatal("failed to request name:", err) - } - service.SetAutoQuitHandler(time.Second*5, func() bool { - m.runningMu.Lock() - r := m.running - m.runningMu.Unlock() - return !r - }) - service.Wait() -} - -func setTheme(name string) error { - if name == themes.GetCursorTheme() { - return nil - } - - err := themes.SetCursorTheme(name) - if err != nil { - logger.Warning("Set failed:", err) - return err - } - return nil -} diff --git a/misc/services/org.deepin.dde.CursorHelper1.service b/misc/services/org.deepin.dde.CursorHelper1.service deleted file mode 100644 index e30f3f22..00000000 --- a/misc/services/org.deepin.dde.CursorHelper1.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.deepin.dde.CursorHelper1 -Exec=/usr/lib/deepin-api/cursor-helper diff --git a/theme_thumb/common/common.go b/theme_thumb/common/common.go deleted file mode 100644 index 2847db5a..00000000 --- a/theme_thumb/common/common.go +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package common - -import ( - "image" - "image/draw" - "image/png" - "os" -) - -func CompositeIcons(images []image.Image, width, height, iconSize, padding int) image.Image { - iconNum := len(images) - destImg := image.NewRGBA(image.Rect(0, 0, width, height)) - if iconNum == 0 { - return destImg - } - - y := (height - iconSize) / 2 - spaceW := width - iconSize*iconNum - x := (spaceW - (iconNum-1)*padding) / 2 - - for _, srcImg := range images { - draw.Draw(destImg, image.Rect(x, y, x+iconSize, y+iconSize), srcImg, image.Pt(0, 0), draw.Src) - x += iconSize + padding - } - - return destImg -} - -func SavePngFile(m image.Image, filename string) error { - f, err := os.Create(filename) - if err != nil { - return err - } - defer func() { - _ = f.Close() - }() - return png.Encode(f, m) -} diff --git a/theme_thumb/cursor/cursor.go b/theme_thumb/cursor/cursor.go deleted file mode 100644 index 3380270b..00000000 --- a/theme_thumb/cursor/cursor.go +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package cursor - -import ( - "image" - "path/filepath" - - "github.com/linuxdeepin/dde-api/theme_thumb/common" -) - -const ( - Version = 1 - basePadding = 12 - baseIconSize = 24 -) - -func Gen(descFile string, width, height int, scaleFactor float64, out string) error { - dir := filepath.Join(filepath.Dir(descFile), "cursors") - - iconSize := int(baseIconSize * scaleFactor) - padding := int(basePadding * scaleFactor) - width = int(float64(width) * scaleFactor) - height = int(float64(height) * scaleFactor) - - images := getCursorIcons(dir, iconSize) - ret := common.CompositeIcons(images, width, height, iconSize, padding) - return common.SavePngFile(ret, out) -} - -var presentCursors = [][]string{ - {"left_ptr"}, - {"left_ptr_watch"}, - {"x-cursor", "X_cursor"}, - {"hand2", "hand1"}, - {"grab", "grabbing", "closedhand"}, - {"fleur", "move"}, - {"sb_v_double_arrow"}, - {"sb_h_double_arrow"}, - {"watch", "wait"}, -} - -func getCursorIcons(dir string, size int) (images []image.Image) { - for _, cursors := range presentCursors { - for _, cursor := range cursors { - img, err := loadXCursor(filepath.Join(dir, cursor), size) - if err == nil { - images = append(images, img) - break - } - } - } - return -} diff --git a/theme_thumb/cursor/load.go b/theme_thumb/cursor/load.go deleted file mode 100644 index b23375a1..00000000 --- a/theme_thumb/cursor/load.go +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package cursor - -/* -#cgo pkg-config: xcursor -#cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -#include -#include -*/ -import "C" -import ( - "fmt" - "image" - "image/color" - "unsafe" - - "github.com/nfnt/resize" -) - -func loadXCursorImage(filename string, size int) *C.XcursorImage { - cFilename := C.CString(filename) - xcImg := C.XcursorFilenameLoadImage(cFilename, C.int(size)) - C.free(unsafe.Pointer(cFilename)) - return xcImg -} - -func destroyXCursorImage(img *C.XcursorImage) { - C.XcursorImageDestroy(img) -} - -func newImageFromXCurorImage(img *C.XcursorImage) image.Image { - width := int(img.width) - height := int(img.height) - n := width * height - // NOTE: (1 << 12) > 48*48 - pixels := (*[1 << 12]C.XcursorPixel)(unsafe.Pointer(img.pixels))[:n:n] - newImg := image.NewRGBA(image.Rect(0, 0, int(img.width), int(img.height))) - var i = 0 - for y := 0; y < height; y++ { - for x := 0; x < width; x++ { - pixel := pixels[i] - // pixel format: ARGB - alpha := uint8(pixel >> 24) - red := uint8((pixel >> 16) & 0xff) - green := uint8((pixel >> 8) & 0xff) - blue := uint8(pixel & 0xff) - color := color.RGBA{R: red, G: green, B: blue, A: alpha} - newImg.SetRGBA(x, y, color) - i++ - } - } - return newImg -} - -func loadXCursor(filename string, size int) (image.Image, error) { - xcImg := loadXCursorImage(filename, size) - if xcImg == nil { - return nil, fmt.Errorf("failed to load x cursor image %q", filename) - } - defer destroyXCursorImage(xcImg) - img := newImageFromXCurorImage(xcImg) - imgWidth := img.Bounds().Dx() - if imgWidth != size { - img = resize.Resize(uint(size), 0, img, resize.Bilinear) - } - return img, nil -} diff --git a/theme_thumb/gtk/gtk.go b/theme_thumb/gtk/gtk.go deleted file mode 100644 index f3f0bb80..00000000 --- a/theme_thumb/gtk/gtk.go +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package gtk - -import ( - "os/exec" - "strconv" -) - -const Version = 0 -const cmd = "/usr/lib/deepin-api/gtk-thumbnailer" - -func Gen(name string, width, height int, scaleFactor float64, dest string) error { - var gdkWinScalingFactor float64 = 1.0 - if scaleFactor > 1.7 { - // 根据 startdde 的逻辑,此种条件下 gtk 窗口放大为 2 倍 - gdkWinScalingFactor = 2.0 - } - - width = int(float64(width) * scaleFactor / gdkWinScalingFactor) - height = int(float64(height) * scaleFactor / gdkWinScalingFactor) - - var args = []string{ - "-theme", name, - "-dest", dest, - "-width", strconv.Itoa(width), - "-height", strconv.Itoa(height), - "-force", - } - _, err := exec.Command(cmd, args...).CombinedOutput() - return err -} diff --git a/theme_thumb/icon/icon.go b/theme_thumb/icon/icon.go deleted file mode 100644 index 1b3d6a6b..00000000 --- a/theme_thumb/icon/icon.go +++ /dev/null @@ -1,189 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package icon - -/* -#cgo pkg-config: gtk+-3.0 gdk-pixbuf-2.0 -#cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -#include -#include -#include -#include - -static char* choose_icon(const char *theme_name, const char **icon_names, int size) { - if (!gtk_init_check(NULL, NULL)) { - g_warning("Init gtk environment failed"); - return FALSE; - } - GtkIconTheme *icon_theme = gtk_icon_theme_new(); - gtk_icon_theme_set_custom_theme(icon_theme, theme_name); - - GtkIconInfo* icon_info = gtk_icon_theme_choose_icon(icon_theme, icon_names, size, 0); - if (icon_info == NULL ) { - g_printf("gtk_icon_theme_choose_icon failed theme_name: %s, size: %d\n", theme_name, size); - g_object_unref(icon_theme); - return NULL; - } - const gchar* filename = gtk_icon_info_get_filename(icon_info); - gchar* filename_dup = g_strdup(filename); - - g_object_unref(icon_info); - g_object_unref(icon_theme); - - return filename_dup; -} - -*/ -import "C" -import ( - "errors" - "fmt" - "image" - "image/png" - "os" - "os/exec" - "path/filepath" - "strconv" - "strings" - "unsafe" - - "github.com/linuxdeepin/dde-api/theme_thumb/common" - "github.com/nfnt/resize" -) - -const ( - Version = 1 - baseIconSize = 48 - basePadding = 4 -) - -// default present icons -var presentIcons = [][]string{ - // file manager: - {"dde-file-manager", "system-file-manager"}, - // music player: - {"deepin-music", "banshee", "amarok", "deadbeef", "clementine", "rhythmbox"}, - // image viewer: - {"deepin-image-viewer", "eog", "gthumb", "gwenview", "gpicview", "showfoto", "phototonic"}, - // media/video player: - {"deepin-movie", "media-player", "totem", "smplayer", "vlc", "dragonplayer", "kmplayer"}, - // launcher: - {"deepin-launcher"}, - // trash: - {"user-trash-full"}, - // text editor: - {"accessories-text-editor", "text-editor", "gedit", "kedit", "xfce-edit"}, - // terminal: - {"deepin-terminal", "utilities-terminal", "terminal", "gnome-terminal", "xfce-terminal", "terminator", "openterm"}, -} - -func Gen(theme string, width, height int, scaleFactor float64, out string) error { - iconSize := int(baseIconSize * scaleFactor) - padding := int(basePadding * scaleFactor) - width = int(float64(width) * scaleFactor) - height = int(float64(height) * scaleFactor) - - images := getIcons(theme, iconSize) - ret := common.CompositeIcons(images, width, height, iconSize, padding) - return common.SavePngFile(ret, out) -} - -// wrap for choose_icon -func chooseIcon(theme string, iconNames []string, size int) string { - cTheme := C.CString(theme) - cArr := cStrv(iconNames) - cNames := (**C.char)(unsafe.Pointer(&cArr[0])) - - cFilename := C.choose_icon(cTheme, cNames, C.int(size)) - filename := C.GoString(cFilename) - - C.free(unsafe.Pointer(cFilename)) - C.free(unsafe.Pointer(cTheme)) - // free cArr - for i := range cArr { - C.free(unsafe.Pointer(cArr[i])) - } - return filename -} - -func ChooseIcon(theme string, iconNames []string, size int) string { - return chooseIcon(theme, iconNames, size) -} - -func loadIcon(theme string, iconNames []string, size int) (img image.Image, err error) { - filename := chooseIcon(theme, iconNames, size) - if filename == "" { - return nil, errors.New("failed to choose icon") - } - ext := strings.ToLower(filepath.Ext(filename)) - if ext == ".svg" { - img, err = loadSvg(filename, size) - } else { - img, err = loadOther(filename) - } - - if err != nil { - return nil, err - } - imgWidth := img.Bounds().Dx() - if imgWidth != size { - img = resize.Resize(uint(size), 0, img, resize.Bilinear) - } - return img, nil -} - -func loadOther(filename string) (image.Image, error) { - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - _ = f.Close() - }() - img, _, err := image.Decode(f) - return img, err -} - -func loadSvg(filename string, size int) (img image.Image, err error) { - sizeStr := strconv.Itoa(size) - cmd := exec.Command("rsvg-convert", "-f", "png", "-w", sizeStr, "-h", sizeStr, filename) - stdout, err := cmd.StdoutPipe() - if err != nil { - return nil, err - } - err = cmd.Start() - if err != nil { - return - } - defer func() { - err = cmd.Wait() - }() - return png.Decode(stdout) -} - -// return NUL-Terminated slice of C String -func cStrv(strv []string) []*C.char { - cArr := make([]*C.char, len(strv)+1) - for i, str := range strv { - cArr[i] = C.CString(str) - } - return cArr -} - -func getIcons(theme string, size int) (images []image.Image) { - for _, iconNames := range presentIcons { - img, err := loadIcon(theme, iconNames, size) - if err != nil { - fmt.Fprintf(os.Stderr, "failed to load icon %s %v: %v\n", theme, iconNames, err) - continue - } - - images = append(images, img) - if len(images) == 6 { - break - } - } - return -} diff --git a/theme_thumb/thumb.go b/theme_thumb/thumb.go deleted file mode 100644 index f2027d3a..00000000 --- a/theme_thumb/thumb.go +++ /dev/null @@ -1,198 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package theme_thumb - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "syscall" - "time" - - "github.com/linuxdeepin/dde-api/theme_thumb/cursor" - "github.com/linuxdeepin/dde-api/theme_thumb/gtk" - "github.com/linuxdeepin/dde-api/theme_thumb/icon" - "github.com/linuxdeepin/go-lib/xdg/basedir" -) - -var scaleFactor float64 - -const ( - width = 320 - height = 70 -) - -var cacheDir = filepath.Join(basedir.GetUserCacheDir(), "deepin", "dde-api", "theme_thumb") - -func getScaleDir() string { - return fmt.Sprintf("X%.2f", scaleFactor) -} - -func getTypeDir(type0 string, version int) string { - return fmt.Sprintf("%s-v%d", type0, version) -} - -func Init(scaleFactor0 float64) { - scaleFactor = scaleFactor0 - removeUnusedScaleDirs() - removeAllTypesOldVersionDirs() -} - -func removeUnusedScaleDirs() { - removeUnusedDirs(cacheDir+"/X*", getScaleDir()) -} - -func removeAllTypesOldVersionDirs() { - scaleDir := getScaleDir() - removeOldVersionDirs(scaleDir, "gtk", gtk.Version) - removeOldVersionDirs(scaleDir, "cursor", cursor.Version) - removeOldVersionDirs(scaleDir, "icon", icon.Version) -} - -func removeOldVersionDirs(scaleDir, type0 string, version int) { - pattern := filepath.Join(cacheDir, scaleDir, type0+"-v*") - usedDir := getTypeDir(type0, version) - removeUnusedDirs(pattern, usedDir) -} - -func removeUnusedDirs(pattern string, usedDir string) { - dirs, err := filepath.Glob(pattern) - if err != nil { - return - } - - for _, dir := range dirs { - name := filepath.Base(dir) - if name != usedDir { - fmt.Println("rm dir", dir) - os.RemoveAll(dir) - } - } -} - -func checkScaleFactor() error { - if scaleFactor <= 0 { - return errors.New("bad scale factor") - } - return nil -} - -func GetCursor(id, descFile string) (string, error) { - err := checkScaleFactor() - if err != nil { - return "", err - } - - out := prepareOutputPath("cursor", id, cursor.Version) - genNew, err := shouldGenerateNewCursor(descFile, out) - if err != nil { - return "", err - } - - if !genNew { - return out, nil - } - - err = cursor.Gen(descFile, width, height, scaleFactor, out) - if err != nil { - return "", err - } - return out, nil -} - -func GetGtk(id, descFile string) (string, error) { - err := checkScaleFactor() - if err != nil { - return "", err - } - - out := prepareOutputPath("gtk", id, gtk.Version) - genNew, err := shouldGenerateNew(descFile, out) - if err != nil { - return "", err - } - - if !genNew { - return out, nil - } - - err = gtk.Gen(id, width, height, scaleFactor, out) - if err != nil { - return "", err - } - return out, nil -} - -func GetIcon(id, descFile string) (string, error) { - err := checkScaleFactor() - if err != nil { - return "", err - } - - out := prepareOutputPath("icon", id, icon.Version) - genNew, err := shouldGenerateNew(descFile, out) - if err != nil { - return "", err - } - - if !genNew { - return out, nil - } - - err = icon.Gen(id, width, height, scaleFactor, out) - if err != nil { - return "", err - } - return out, nil -} - -func shouldGenerateNew(descFile, out string) (bool, error) { - descFileInfo, err := os.Stat(descFile) - if err != nil { - return false, err - } - - descFileCTime := getChangeTime(descFileInfo) - - thumbFileInfo, err := os.Stat(out) - if err != nil { - if os.IsNotExist(err) { - return true, nil - } - return false, err - } - thumbFileCTime := getChangeTime(thumbFileInfo) - - if descFileCTime.After(thumbFileCTime) { - return true, nil - } - return false, nil -} - -func shouldGenerateNewCursor(descFile, out string) (bool, error) { - dir := filepath.Dir(descFile) - ptrFile := filepath.Join(dir, "cursors", "left_ptr") - return shouldGenerateNew(ptrFile, out) -} - -// getChangeTime get time when file status was last changed. -func getChangeTime(fileInfo os.FileInfo) time.Time { - stat := fileInfo.Sys().(*syscall.Stat_t) - return time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec)) -} - -// ex. $HOME/.cache/deepin/dde-api/theme_thumb/X1.00/icon-v0/deepin.png -func prepareOutputPath(type0, id string, version int) string { - scaleDir := getScaleDir() - typeDir := getTypeDir(type0, version) - dir := filepath.Join(cacheDir, scaleDir, typeDir) - - err := os.MkdirAll(dir, 0755) - if err != nil { - return "" - } - return filepath.Join(dir, id+".png") -} diff --git a/themes/cursor.c b/themes/cursor.c deleted file mode 100644 index 76625eae..00000000 --- a/themes/cursor.c +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include -#include - -#include "cursor.h" - -int -init_gtk() -{ - static gboolean xcb_init = FALSE; - - if (!xcb_init) { - XInitThreads(); - - if (!gtk_init_check(NULL, NULL)) { - return -1; - } - } - xcb_init = TRUE; - return 0; -} - -void -set_gtk_cursor(char* name) -{ - GtkSettings* s = gtk_settings_get_default(); - g_object_set(G_OBJECT(s), "gtk-cursor-theme-name", name, NULL); -} diff --git a/themes/cursor.go b/themes/cursor.go deleted file mode 100644 index 471b9198..00000000 --- a/themes/cursor.go +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -// #cgo pkg-config: x11 xcursor xfixes gtk+-3.0 -// #cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -// #include -// #include "cursor.h" -import "C" -import ( - "unsafe" -) - -func setGtkCursor(name string) { - C.init_gtk() - cName := C.CString(name) - defer C.free(unsafe.Pointer(cName)) - C.set_gtk_cursor(cName) -} - -func setQtCursor(name string) { - cName := C.CString(name) - defer C.free(unsafe.Pointer(cName)) - C.set_qt_cursor(cName) -} diff --git a/themes/cursor.h b/themes/cursor.h deleted file mode 100644 index c1a9f2ad..00000000 --- a/themes/cursor.h +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __CURSOR_H__ -#define __CURSOR_H__ - -int init_gtk(); -void set_gtk_cursor(char* name); -int set_qt_cursor(const char* name); - -#endif diff --git a/themes/gtk2.go b/themes/gtk2.go deleted file mode 100644 index e6be340d..00000000 --- a/themes/gtk2.go +++ /dev/null @@ -1,127 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -import ( - "io/ioutil" - "os" - "path" - "strings" - "sync" -) - -const ( - gtk2ConfDelim = "=" -) - -type gtk2ConfInfo struct { - key string - value string -} -type gtk2ConfInfos []*gtk2ConfInfo - -var ( - gtk2Locker sync.Mutex - gtk2ConfFile = path.Join(os.Getenv("HOME"), ".gtkrc-2.0") -) - -func setGtk2Theme(name string) error { - return setGtk2Prop("gtk-theme-name", - "\""+name+"\"", gtk2ConfFile) -} - -func setGtk2Icon(name string) error { - return setGtk2Prop("gtk-icon-theme-name", - "\""+name+"\"", gtk2ConfFile) -} - -func setGtk2Cursor(name string) error { - return setGtk2Prop("gtk-cursor-theme-name", - "\""+name+"\"", gtk2ConfFile) -} - -func setGtk2Prop(key, value, file string) error { - gtk2Locker.Lock() - defer gtk2Locker.Unlock() - - infos := gtk2FileReader(file) - info := infos.Get(key) - if info == nil { - infos = infos.Add(key, value) - } else { - if info.value == value { - return nil - } - info.value = value - } - return gtk2FileWriter(infos, file) -} - -func (infos gtk2ConfInfos) Get(key string) *gtk2ConfInfo { - for _, info := range infos { - if info.key == key { - return info - } - } - return nil -} - -func (infos gtk2ConfInfos) Add(key, value string) gtk2ConfInfos { - for _, info := range infos { - if info.key == key { - info.value = value - return infos - } - } - - infos = append(infos, >k2ConfInfo{ - key: key, - value: value, - }) - return infos -} - -func gtk2FileWriter(infos gtk2ConfInfos, file string) error { - var content string - length := len(infos) - for i, info := range infos { - content += info.key + gtk2ConfDelim + info.value - if i != length-1 { - content += "\n" - } - } - - err := os.MkdirAll(path.Dir(file), 0755) - if err != nil { - return err - } - return ioutil.WriteFile(file, []byte(content), 0644) -} - -func gtk2FileReader(file string) gtk2ConfInfos { - var infos gtk2ConfInfos - content, err := ioutil.ReadFile(file) - if err != nil { - return infos - } - - var lines = strings.Split(string(content), "\n") - for _, line := range lines { - if len(line) == 0 { - continue - } - - array := strings.Split(line, gtk2ConfDelim) - if len(array) != 2 { - continue - } - - infos = append(infos, >k2ConfInfo{ - key: array[0], - value: array[1], - }) - } - return infos -} diff --git a/themes/gtk2_test.go b/themes/gtk2_test.go deleted file mode 100644 index 8d2a967e..00000000 --- a/themes/gtk2_test.go +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestGtk2Infos(t *testing.T) { - infos := gtk2FileReader("testdata/gtkrc-2.0") - assert.Equal(t, len(infos), 16) - - info := infos.Get("gtk-theme-name") - assert.Equal(t, info.value, "\"Paper\"") - - info.value = "\"Deepin\"" - assert.Equal(t, info.value, "\"Deepin\"") - - infos = infos.Add("gtk2-test", "test") - assert.Equal(t, len(infos), 17) - - infos = gtk2FileReader("testdata/xxx") - infos = infos.Add("gtk2-test", "test") - assert.Equal(t, len(infos), 1) - info = infos.Get("gtk2-test") - assert.Equal(t, info.value, "test") - - err := gtk2FileWriter(infos, "testdata/tmp-gtk2rc") - defer os.Remove("testdata/tmp-gtk2rc") - assert.Nil(t, err) -} diff --git a/themes/gtk3.go b/themes/gtk3.go deleted file mode 100644 index 90fb6ffe..00000000 --- a/themes/gtk3.go +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -import ( - "io/ioutil" - "os" - "path" - "sync" - - "github.com/linuxdeepin/go-gir/glib-2.0" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - gtk3GroupSettings = "Settings" - gtk3KeyTheme = "gtk-theme-name" - gtk3KeyIcon = "gtk-icon-theme-name" - gtk3KeyCursor = "gtk-cursor-theme-name" -) - -var ( - gtk3Locker sync.Mutex - gtk3ConfFile = path.Join(os.Getenv("HOME"), - ".config", "gtk-3.0", "settings.ini") -) - -func setGtk3Theme(name string) error { - return setGtk3Prop(gtk3KeyTheme, name, gtk3ConfFile) -} - -func setGtk3Icon(name string) error { - return setGtk3Prop(gtk3KeyIcon, name, gtk3ConfFile) -} - -func setGtk3Cursor(name string) error { - return setGtk3Prop(gtk3KeyCursor, name, gtk3ConfFile) -} - -func setGtk3Prop(key, value, file string) error { - gtk3Locker.Lock() - defer gtk3Locker.Unlock() - - if !dutils.IsFileExist(file) { - err := os.MkdirAll(path.Dir(file), 0755) - if err != nil { - return err - } - - err = dutils.CreateFile(file) - if err != nil { - return err - } - } - - kfile, err := dutils.NewKeyFileFromFile(file) - if kfile == nil { - return err - } - defer kfile.Free() - - if isGtk3PropEqual(key, value, kfile) { - return nil - } - - return doSetGtk3Prop(key, value, file, kfile) -} - -func isGtk3PropEqual(key, value string, kfile *glib.KeyFile) bool { - old, _ := kfile.GetString(gtk3GroupSettings, key) - return old == value -} - -func doSetGtk3Prop(key, value, file string, kfile *glib.KeyFile) error { - kfile.SetString(gtk3GroupSettings, key, value) - _, content, err := kfile.ToData() - if err != nil { - return err - } - return ioutil.WriteFile(file, []byte(content), 0644) -} diff --git a/themes/gtk3_test.go b/themes/gtk3_test.go deleted file mode 100644 index 19e9a02b..00000000 --- a/themes/gtk3_test.go +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -func TestGtk3Prop(t *testing.T) { - kfile, err := dutils.NewKeyFileFromFile("testdata/settings.ini") - assert.Nil(t, err) - defer kfile.Free() - - assert.Equal(t, isGtk3PropEqual(gtk3KeyTheme, "Paper", - kfile), true) - assert.Equal(t, isGtk3PropEqual("gtk-menu-images", "1", - kfile), true) - assert.Equal(t, isGtk3PropEqual("gtk-modules", "gail:atk-bridge", - kfile), true) - assert.Equal(t, isGtk3PropEqual("test-list", "1;2;3;", - kfile), true) - - err = setGtk3Prop("test-gtk3", "test", "testdata/tmp-gtk3") - defer os.Remove("testdata/tmp-gtk3") - assert.Nil(t, err) -} diff --git a/themes/qt_cursor.c b/themes/qt_cursor.c deleted file mode 100644 index ef139495..00000000 --- a/themes/qt_cursor.c +++ /dev/null @@ -1,176 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include -#include -#include -#include -#include - -#include "cursor.h" - -static char* findAlternative(const char *name); -static XcursorImages* xcLoadImages(const char *theme, - const char *image, int size); -static unsigned long loadCursorHandle(Display *disp, - const char *theme, const char *name, int size); - -static char* -findAlternative(const char *name) -{ - // Qt uses non-standard names for some core cursors. - // If Xcursor fails to load the cursor, Qt creates it with the correct name - // using the core protocol instead (which in turn calls Xcursor). - // We emulate that process here. - // Note that there's a core cursor called cross, but it's not the one Qt expects. - // Precomputed MD5 hashes for the hardcoded bitmap cursors in Qt and KDE. - // Note that the MD5 hash for left_ptr_watch is for the KDE version of that cursor. - static char* xcursor_alter[] = { - "cross", "crosshair", - "up_arrow", "center_ptr", - "wait", "watch", - "ibeam", "xterm", - "size_all", "fleur", - "pointing_hand", "hand2", - // Precomputed MD5 hashes for the hardcoded bitmap cursors in Qt and KDE. - // Note that the MD5 hash for left_ptr_watch is for the KDE version of that cursor. - "size_ver", "00008160000006810000408080010102", - "size_hor", "028006030e0e7ebffc7f7070c0600140", - "size_bdiag", "c7088f0f3e6c8088236ef8e1e3e70000", - "size_fdiag", "fcf1c3c7cd4491d801f1e1c78f100000", - "whats_this", "d9ce0ab605698f320427677b458ad60b", - "split_h", "14fef782d02440884392942c11205230", - "split_v", "2870a09082c103050810ffdffffe0204", - "forbidden", "03b6e0fcb3499374a867c041f52298f0", - "left_ptr_watch", "3ecb610c1bf2410f44200f48c40d3599", - "hand2", "e29285e634086352946a0e7090d73106", - "openhand", "9141b49c8149039304290b508d208c40", - "closedhand", "05e88622050804100c20044008402080", - NULL}; - - int i; - for (i = 0; xcursor_alter[i] != NULL; i+=2) { - if (strcmp(xcursor_alter[i], name) == 0) { - return xcursor_alter[i+1]; - } - } - - return NULL; -} - -static XcursorImages* -xcLoadImages(const char *theme, const char *image, int size) -{ - return XcursorLibraryLoadImages(image, theme, size); -} - -static unsigned long -loadCursorHandle(Display *disp, const char *theme, const char *name, int size) -{ - if (size == -1) { - size = XcursorGetDefaultSize(disp); - } - - // Load the cursor images - XcursorImages *images = NULL; - images = xcLoadImages(theme, name, size); - if (!images) { - images = xcLoadImages(theme, - findAlternative(name), size); - if (!images) { - return 0; - } - } - - unsigned long handle = (unsigned long)XcursorImagesLoadCursor(disp, - images); - XcursorImagesDestroy(images); - - return handle; -} - -int -set_qt_cursor(const char *name) -{ - if (!name) { - fprintf(stderr, "Cursor theme is NULL\n"); - return -1; - } - - /** - * Fixed Qt cursor not work when cursor theme changed. - * For details see: lxqt-config/lxqt-config-cursor - * - * XFixes multiple qt cursor name, a X Error will be occurred. - * Now only XFixes qt cursor name 'left_ptr' - * Why? - **/ - static char* list[] = { - // Qt cursors - "left_ptr", - "up_arrow", - "cross", - "wait", - "left_ptr_watch", - "ibeam", - "size_ver", - "size_hor", - "size_bdiag", - "size_fdiag", - "size_all", - "split_v", - "split_h", - "pointing_hand", - "openhand", - "closedhand", - "forbidden", - "whats_this", - // X core cursors - "X_cursor", - "right_ptr", - "hand1", - "hand2", - "watch", - "xterm", - "crosshair", - "left_ptr_watch", - "center_ptr", // invalid Cursor parameter, why? - "sb_h_double_arrow", - "sb_v_double_arrow", - "fleur", - "top_left_corner", - "top_side", - "top_right_corner", - "right_side", - "bottom_right_corner", - "bottom_side", - "bottom_left_corner", - "left_side", - "question_arrow", - "pirate", - NULL}; - - Display *disp = XOpenDisplay(0); - if (!disp) { - fprintf(stderr, "Open display failed\n"); - return -1; - } - - int i; - for (i = 0; list[i] != NULL; i++) { - Cursor cursor = (Cursor)loadCursorHandle(disp, name, - list[i], -1); - if (cursor == 0) { - printf("Load cursor %s failed\n", list[i]); - continue; - } - - XFixesChangeCursorByName(disp, cursor, list[i]); - // FIXME: do we need to free the cursor? - XFreeCursor(disp, cursor); - } - XCloseDisplay(disp); - - return 0; -} diff --git a/themes/scanner/scanner.go b/themes/scanner/scanner.go deleted file mode 100644 index ed44aa72..00000000 --- a/themes/scanner/scanner.go +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Theme scanner -package scanner - -import ( - "fmt" - "os" - "path" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - ThemeTypeGtk = "gtk" - ThemeTypeIcon = "icon" - ThemeTypeCursor = "cursor" -) - -// uri: ex "file:///usr/share/themes" -func ListGtkTheme(uri string) ([]string, error) { - return doListTheme(uri, ThemeTypeGtk, IsGtkTheme) -} - -// uri: ex "file:///usr/share/icons" -func ListIconTheme(uri string) ([]string, error) { - return doListTheme(uri, ThemeTypeIcon, IsIconTheme) -} - -// uri: ex "file:///usr/share/icons" -func ListCursorTheme(uri string) ([]string, error) { - return doListTheme(uri, ThemeTypeCursor, IsCursorTheme) -} - -func IsGtkTheme(uri string) bool { - if len(uri) == 0 { - return false - } - - ty, _ := mime.Query(uri) - return ty == mime.MimeTypeGtk -} - -func IsIconTheme(uri string) bool { - if len(uri) == 0 { - return false - } - - ty, _ := mime.Query(uri) - return ty == mime.MimeTypeIcon -} - -func IsCursorTheme(uri string) bool { - if len(uri) == 0 { - return false - } - - ty, _ := mime.Query(uri) - return ty == mime.MimeTypeCursor -} - -func doListTheme(uri string, ty string, filter func(string) bool) ([]string, error) { - dir := dutils.DecodeURI(uri) - subDirs, err := listSubDir(dir) - if err != nil { - return nil, err - } - - var themes []string - for _, subDir := range subDirs { - var tmp string - if ty == ThemeTypeCursor { - tmp = path.Join(subDir, "cursor.theme") - } else { - tmp = path.Join(subDir, "index.theme") - } - if !filter(tmp) || isHidden(tmp, ty) { - continue - } - themes = append(themes, subDir) - } - return themes, nil -} - -func listSubDir(dir string) ([]string, error) { - if !dutils.IsDir(dir) { - return nil, fmt.Errorf("'%s' not a dir", dir) - } - - fr, err := os.Open(dir) - if err != nil { - return nil, err - } - defer func() { - fr.Close() - }() - - names, err := fr.Readdirnames(-1) - if err != nil { - return nil, err - } - - var subDirs []string - for _, name := range names { - tmp := path.Join(dir, name) - if !dutils.IsDir(tmp) { - continue - } - - subDirs = append(subDirs, tmp) - } - return subDirs, nil - -} - -func isHidden(file, ty string) bool { - kf, err := dutils.NewKeyFileFromFile(file) - if err != nil { - return false - } - defer kf.Free() - - var hidden bool = false - switch ty { - case ThemeTypeGtk: - hidden, _ = kf.GetBoolean("Desktop Entry", "Hidden") - case ThemeTypeIcon, ThemeTypeCursor: - hidden, _ = kf.GetBoolean("Icon Theme", "Hidden") - } - return hidden -} diff --git a/themes/scanner/scanner_test.go b/themes/scanner/scanner_test.go deleted file mode 100644 index 0e0dce9c..00000000 --- a/themes/scanner/scanner_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package scanner - -import ( - "sort" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestListGtkTheme(t *testing.T) { - list, err := ListGtkTheme("testdata/Themes") - sort.Strings(list) - assert.ElementsMatch(t, list, []string{ - "testdata/Themes/Gtk1", - "testdata/Themes/Gtk2"}) - assert.Nil(t, err) -} - -func TestListIconTheme(t *testing.T) { - list, err := ListIconTheme("testdata/Icons") - sort.Strings(list) - assert.ElementsMatch(t, list, []string{ - "testdata/Icons/Icon1", - "testdata/Icons/Icon2"}) - assert.Nil(t, err) -} - -func TestListCursorTheme(t *testing.T) { - list, err := ListCursorTheme("testdata/Icons") - sort.Strings(list) - assert.ElementsMatch(t, list, []string{ - "testdata/Icons/Icon1", - "testdata/Icons/Icon2"}) - assert.Nil(t, err) -} - -func TestThemeHidden(t *testing.T) { - assert.Equal(t, isHidden("testdata/gtk_paper.theme", ThemeTypeGtk), false) - assert.Equal(t, isHidden("testdata/gtk_paper_hidden.theme", ThemeTypeGtk), true) - - assert.Equal(t, isHidden("testdata/icon_deepin.theme", ThemeTypeIcon), false) - assert.Equal(t, isHidden("testdata/icon_deepin_hidden.theme", ThemeTypeIcon), true) -} diff --git a/themes/scanner/testdata/Icons/Icon1/cursors/left_ptr b/themes/scanner/testdata/Icons/Icon1/cursors/left_ptr deleted file mode 100644 index 61f968ef..00000000 Binary files a/themes/scanner/testdata/Icons/Icon1/cursors/left_ptr and /dev/null differ diff --git a/themes/scanner/testdata/Icons/Icon1/index.theme b/themes/scanner/testdata/Icons/Icon1/index.theme deleted file mode 100644 index 123b925b..00000000 --- a/themes/scanner/testdata/Icons/Icon1/index.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 diff --git a/themes/scanner/testdata/Icons/Icon2/cursors/left_ptr b/themes/scanner/testdata/Icons/Icon2/cursors/left_ptr deleted file mode 100644 index 61f968ef..00000000 Binary files a/themes/scanner/testdata/Icons/Icon2/cursors/left_ptr and /dev/null differ diff --git a/themes/scanner/testdata/Icons/Icon2/index.theme b/themes/scanner/testdata/Icons/Icon2/index.theme deleted file mode 100644 index 123b925b..00000000 --- a/themes/scanner/testdata/Icons/Icon2/index.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 diff --git a/themes/scanner/testdata/Themes/Gtk1/cursors/left_ptr b/themes/scanner/testdata/Themes/Gtk1/cursors/left_ptr deleted file mode 100644 index 61f968ef..00000000 Binary files a/themes/scanner/testdata/Themes/Gtk1/cursors/left_ptr and /dev/null differ diff --git a/themes/scanner/testdata/Themes/Gtk1/gtk-2.0/gtkrc b/themes/scanner/testdata/Themes/Gtk1/gtk-2.0/gtkrc deleted file mode 100644 index 4936bf92..00000000 --- a/themes/scanner/testdata/Themes/Gtk1/gtk-2.0/gtkrc +++ /dev/null @@ -1,786 +0,0 @@ -# Numix GTK Theme - -gtk-color-scheme = "bg_color:#fdfdfd\nfg_color:#282828\nbase_color:#ffffff\ntext_color:#333333\nselected_bg_color:#2CA7F8\nselected_fg_color:#f9f9f9\ntooltip_bg_color:#2d2d2d\ntooltip_fg_color:#dedede\ntitlebar_bg_color:#252627\ntitlebar_fg_color:#dcdcdc\nmenubar_bg_color:#252627\nmenubar_fg_color:#dcdcdc\ntoolbar_bg_color:#dedede\ntoolbar_fg_color:#555555\nmenu_bg_color:#2d2d2d\nmenu_fg_color:#dcdcdc\npanel_bg_color:#252627\npanel_fg_color:#dcdcdc\nlink_color:#007aff" - -# Default Style - -style "murrine-default" { - GtkArrow::arrow-scaling= 0.6 - - GtkButton::child-displacement-x = 0 - GtkButton::child-displacement-y = 0 - - GtkButton::default-border = { 0, 0, 0, 0 } - - GtkButtonBox::child-min-height = 26 - - GtkCheckButton::indicator-size = 16 - - # The following line hints to gecko (and possibly other appliations) - # that the entry should be drawn transparently on the canvas. - # Without this, gecko will fill in the background of the entry. - GtkEntry::honors-transparent-bg-hint = 1 - GtkEntry::state-hint = 0 - - GtkExpander::expander-size = 16 - - GtkImage::x-ayatana-indicator-dynamic = 1 - - GtkMenu::horizontal-padding = 0 - GtkMenu::vertical-padding = 0 - - GtkMenuBar::internal-padding = 0 - GtkMenuBar::window-dragging = 1 - - GtkMenuItem::arrow-scaling= 0.5 - - GtkPaned::handle-size = 1 - - GtkProgressBar::min-horizontal-bar-height = 12 - GtkProgressBar::min-vertical-bar-width = 12 - - GtkRange::trough-border = 0 - GtkRange::slider-width = 12 - GtkRange::stepper-size = 12 - GtkRange::stepper_spacing = 0 - GtkRange::trough-under-steppers = 1 - - GtkScale::slider-length = 16 - GtkScale::slider-width = 16 - GtkScale::trough-side-details = 1 - - GtkScrollbar::activate-slider = 1 - GtkScrollbar::has-backward-stepper = 0 - GtkScrollbar::has-forward-stepper = 0 - GtkScrollbar::has-secondary-backward-stepper = 0 - GtkScrollbar::has-secondary-forward-stepper = 0 - GtkScrollbar::min-slider-length = 80 - GtkScrollbar::slider-width = 4 - GtkScrollbar::trough-border = 0 - - GtkScrolledWindow::scrollbar-spacing = 0 - GtkScrolledWindow::scrollbars-within-bevel = 1 - - GtkSeparatorMenuItem::horizontal-padding = 0 - - GtkToolbar::internal-padding = 0 - - GtkTreeView::expander-size = 11 - GtkTreeView::vertical-separator = 0 - - GtkWidget::focus-line-width = 1 - # The following line prevents the Firefox tabs - # from jumping a few pixels when you create a new tab - GtkWidget::focus-padding = 0 - - GtkWidget::wide-separators = 1 - GtkWidget::separator-width = 1 - GtkWidget::separator-height = 1 - - GtkWindow::resize-grip-height = 0 - GtkWindow::resize-grip-width = 0 - - WnckTasklist::fade-overlay-rect = 0 - - GnomeHRef::link_color = @link_color - GtkHTML::link-color = @link_color - GtkIMHtmlr::hyperlink-color = @link_color - GtkIMHtml::hyperlink-color = @link_color - GtkWidget::link-color = @link_color - GtkWidget::visited-link-color = @text_color - - GtkToolbar::shadow-type = GTK_SHADOW_NONE # Makes toolbars flat and unified - GtkMenuBar::shadow-type = GTK_SHADOW_NONE # Makes menubars flat and unified - - xthickness = 1 - ythickness = 1 - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - bg[NORMAL] = @bg_color - bg[PRELIGHT] = shade (1.02, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.9, @bg_color) - bg[INSENSITIVE] = @bg_color - - base[NORMAL] = @base_color - base[PRELIGHT] = shade (0.95, @base_color) - base[SELECTED] = @selected_bg_color - base[ACTIVE] = @selected_bg_color - base[INSENSITIVE] = shade (0.85, @base_color) - - text[NORMAL] = @text_color - text[PRELIGHT] = @text_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @selected_fg_color - text[INSENSITIVE] = mix (0.5, @base_color, @text_color) - - engine "murrine" { - animation = FALSE - arrowstyle = 1 # 0 = normal arrows, 1 = filled arrows - border_shades = { 1.0, 1.0 } # gradient to draw on border - colorize_scrollbar = FALSE - comboboxstyle = 0 # 0 = normal combobox, 1 = colorized combobox below arrow - contrast = 0.8 # overal contrast with borders - focusstyle = 1 # 0 = none, 1 = grey dotted, 2 = colored with fill, 3 = colored glow - glazestyle = 0 # 0 = flat highlight, 1 = curved highlight, 2 = concave, 3 = top curved highlight, 4 = beryl highlight - glowstyle = 0 # 0 = glow on top, 1 = glow on bottom, 2 = glow on top and bottom, 3 = glow on middle vertically, 4 = glow on middle horizontally, 5 = glow on all sides - glow_shade = 1.0 # amount of glow - gradient_shades = { 1.0, 1.0, 1.0, 1.0 } # gradient to draw on widgets - highlight_shade = 1.0 # amount of highlight - lightborder_shade = 1.0 # amount of inset light border - lightborderstyle = 1 # 0 = lightborder on top side, 1 = lightborder on all sides - listviewheaderstyle = 0 # 0 = flat, 1 = glassy, 2 = raised - listviewstyle = 0 # 0 = none, 1 = dotted, 2 = line - menubaritemstyle = 0 # 0 = menuitem look, 1 = button look - menubarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient, 3 = striped - menuitemstyle = 0 # 0 = flat, 1 = glassy, 2 = striped - menustyle = 0 # 0 = none, 1 = vertical striped - progressbarstyle = 0 # 0 = none, 1 = diagonal striped, 2 = vertical striped - reliefstyle = 0 # 0 = flat, 1 = inset, 2 = shadow, 3 = shadow with gradient, 4 = stronger shadow with gradient - roundness = 2 # roundness of widgets - scrollbarstyle = 0 # 0 = none, 1 = circles, 2 = handles, 3 = diagonal stripes, 4 = diagonal stripes and handles, 5 = horizontal stripes, 6 = horizontal stripes and handles - sliderstyle = 0 # 0 = none, 1 = handles - stepperstyle = 1 # 0 = standard, 1 = integrated stepper handles - toolbarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient - } -} - -style "murrine-wide" { - xthickness = 2 - ythickness = 2 -} - -style "murrine-wider" { - xthickness = 3 - ythickness = 3 -} - -style "murrine-thin" { - xthickness = 0 - ythickness = 0 -} - -# Notebook - -style "murrine-notebook-bg" { - bg[NORMAL] = @base_color - bg[ACTIVE] = shade (0.87, @base_color) -} - -style "murrine-notebook" = "murrine-notebook-bg" { - xthickness = 2 - ythickness = 2 - - engine "murrine" { - roundness = 2 - } -} - -# Various Standard Widgets - -style "murrine-button" = "murrine-wider" { - xthickness = 3 - ythickness = 3 - - bg[NORMAL] = shade (0.96, @base_color) - bg[PRELIGHT] = "#9ad7ff" - bg[ACTIVE] = "#68c3ff" - bg[INSENSITIVE] = shade (0.95, @bg_color) - - fg[NORMAL] = shade (0.95, @fg_color) - - engine "murrine" { - contrast = 0.85 - roundness = 3 - gradient_shades = {1.05,1.0,1.0,0.98} - border_shades = {1.10, 0.95} - - lightborderstyle = 1 # 0 = top side, 1 = all sides - lightborder_shade = 1.3 - highlight_shade = 1.03 - focusstyle = 0 - glowstyle = 0 # 0 = top, 1 = bottom, 2 = top and bottom, 3 = horizontal, 4 = centered glow - glow_shade = 1.05 - reliefstyle = 3 - textstyle = 1 - text_shade = 1.2 - } -} - -style "murrine-scrollbar" { - bg[NORMAL] = mix (0.21, @fg_color, @bg_color) - bg[PRELIGHT] = mix (0.31, @fg_color, @bg_color) - bg[ACTIVE] = @selected_bg_color - - engine "murrine" { - roundness = 0 - contrast = 0.0 - border_shades = { 0.9, 0.9 } - trough_shades = { 0.97, 0.97 } - trough_border_shades = { 1.0, 1.0 } - } -} - -style "murrine-overlay-scrollbar" { - bg[ACTIVE] = shade (0.8, @bg_color) - bg[INSENSITIVE] = shade (0.97, @bg_color) - - base[SELECTED] = shade (0.6, @base_color) - base[INSENSITIVE] = shade (0.85, @base_color) -} - -style "murrine-scale" = "murrine-thin" { - bg[NORMAL] = @bg_color - bg[ACTIVE] = @bg_color - bg[SELECTED] = @selected_bg_color - bg[INSENSITIVE] = shade (0.95, @bg_color) - - engine "murrine" { - roundness = 8 - gradient_shades = { 1.08, 1.08, 1.08, 1.08 } - border_shades = { 1.0, 1.0 } - trough_shades = { 1.08, 1.08 } - trough_border_shades = { 0.8, 0.8 } - } -} - -style "murrine-progressbar" = "murrine-thin" { - bg[NORMAL] = @bg_color - bg[ACTIVE] = shade (1.08, @bg_color) - - fg[PRELIGHT] = @selected_fg_color - - engine "murrine" { - roundness = 3 - border_shades = { 1.2, 1.2 } - trough_border_shades = { 0.9, 0.9 } - } -} - -style "murrine-treeview-header" = "murrine-button" { - engine "murrine" { - roundness = 0 - } -} - -style "murrine-treeview" { - engine "murrine" { - roundness = 0 - } -} - -style "murrine-frame-title" { - fg[NORMAL] = lighter (@fg_color) -} - -style "murrine-tooltips" { - xthickness = 5 - ythickness = 5 - - bg[NORMAL] = @tooltip_bg_color - bg[SELECTED] = @tooltip_bg_color - - fg[NORMAL] = @tooltip_fg_color - - engine "murrine" { - textstyle = 0 - roundness = 2 - rgba = FALSE - } -} - -style "murrine-spinbutton" = "murrine-button" { - engine "murrine" { - } -} - -style "murrine-radiocheck" = "murrine-default" { - bg[NORMAL] = @base_color - bg[PRELIGHT] = "#9ad7ff" - bg[SELECTED] = @base_color - - text[NORMAL] = @text_color - text[PRELIGHT] = @text_color -} - -style "murrine-entry" = "murrine-wider" { - engine "murrine" { - border_shades = { 1.15, 1.15 } - } -} - -style "metacity-frame" = "murrine-default" { - bg[SELECTED] = @selected_bg_color -} - -style "murrine-statusbar" { } -style "murrine-comboboxentry" = "murrine-entry" { } -style "murrine-hscale" = "murrine-scale" { } -style "murrine-vscale" = "murrine-scale" { } -style "murrine-hscrollbar" = "murrine-scrollbar" { } -style "murrine-vscrollbar" = "murrine-scrollbar" { } - -# Menus - -style "murrine-menu" = "murrine-thin" { - bg[NORMAL] = @menu_bg_color - bg[PRELIGHT] = @selected_bg_color - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = @menu_bg_color - bg[INSENSITIVE] = @menu_bg_color - - fg[NORMAL] = @menu_fg_color - fg[PRELIGHT] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - text[NORMAL] = @menu_fg_color - text[PRELIGHT] = @selected_fg_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @selected_fg_color - text[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -style "murrine-menu-item" = "murrine-wider" { - bg[PRELIGHT] = @selected_bg_color - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = @selected_bg_color - - fg[NORMAL] = @menu_fg_color # Fix for XFCE menu text - fg[PRELIGHT] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - engine "murrine" { - textstyle = 0 - border_shades = { 1.2, 1.2 } - } -} - -style "murrine-separator-menu-item" = "murrine-thin" { } - -style "murrine-menubar" { - bg[NORMAL] = @menubar_bg_color - bg[PRELIGHT] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[SELECTED] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[ACTIVE] = shade (0.9, @menubar_bg_color) - bg[INSENSITIVE] = @menubar_bg_color - - fg[NORMAL] = @menubar_fg_color - fg[PRELIGHT] = shade (1.08, @menubar_fg_color) - fg[SELECTED] = shade (1.08, @menubar_fg_color) - fg[ACTIVE] = @menubar_fg_color - fg[INSENSITIVE] = mix (0.5, @menubar_bg_color, @menubar_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -style "murrine-menubaritem" { - bg[NORMAL] = @menubar_bg_color - bg[PRELIGHT] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[SELECTED] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[ACTIVE] = shade (0.9, @menubar_bg_color) - bg[INSENSITIVE] = @menubar_bg_color - - fg[NORMAL] = @menubar_fg_color - fg[PRELIGHT] = shade (1.08, @menubar_fg_color) - fg[SELECTED] = shade (1.08, @menubar_fg_color) - fg[ACTIVE] = @menubar_fg_color - fg[INSENSITIVE] = mix (0.5, @menubar_bg_color, @menubar_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -# Toolbars - -style "murrine-toolbar" = "murrine-thin" { - bg[NORMAL] = @base_color - bg[PRELIGHT] = shade (1.02, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.9, @bg_color) - bg[INSENSITIVE] = @bg_color - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - engine "murrine" { - } -} - -style "murrine-toolbutton" = "murrine-button" { - bg[NORMAL] = shade (1.08, @bg_color) - bg[PRELIGHT] = shade (1.10, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.95, @bg_color) - bg[INSENSITIVE] = shade (0.85, @bg_color) - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - engine "murrine" { - } -} - -class "GtkToolbar" style "murrine-toolbar" -class "GtkHandleBox" style "murrine-toolbar" -widget_class "*Toolbar*.*Separator*" style "murrine-toolbar" - -# Panels - -style "murrine-panel" = "murrine-thin" { - xthickness = 2 - - bg[NORMAL] = @panel_bg_color - bg[PRELIGHT] = mix (0.21, @panel_fg_color, @panel_bg_color) - bg[SELECTED] = mix (0.21, @panel_fg_color, @panel_bg_color) - bg[ACTIVE] = shade (0.8, @panel_bg_color) - bg[INSENSITIVE] = @panel_bg_color - - fg[NORMAL] = @panel_fg_color - fg[PRELIGHT] = shade (1.08, @panel_fg_color) - fg[SELECTED] = shade (1.08, @panel_fg_color) - fg[ACTIVE] = @panel_fg_color - fg[INSENSITIVE] = mix (0.5, @panel_bg_color, @panel_fg_color) - - base[NORMAL] = @panel_bg_color - base[PRELIGHT] = mix (0.21, @panel_fg_color, @panel_bg_color) - base[SELECTED] = mix (0.21, @panel_fg_color, @panel_bg_color) - base[ACTIVE] = shade (0.9, @panel_bg_color) - base[INSENSITIVE] = @panel_bg_color - - text[NORMAL] = @panel_fg_color - text[PRELIGHT] = shade (1.08, @panel_fg_color) - text[SELECTED] = shade (1.08, @panel_fg_color) - text[ACTIVE] = @panel_fg_color - text[INSENSITIVE] = mix (0.5, @panel_bg_color, @panel_fg_color) - - engine "murrine" { - roundness = 0 - contrast = 0.0 - } -} - -widget "*PanelWidget*" style "murrine-panel" -widget "*PanelApplet*" style "murrine-panel" -widget "*fast-user-switch*" style "murrine-panel" -widget "*CPUFreq*Applet*" style "murrine-panel" -widget "*indicator-applet*" style "murrine-panel" -class "PanelApp*" style "murrine-panel" -class "PanelToplevel*" style "murrine-panel" -widget_class "*PanelToplevel*" style "murrine-panel" -widget_class "*notif*" style "murrine-panel" -widget_class "*Notif*" style "murrine-panel" -widget_class "*Tray*" style "murrine-panel" -widget_class "*tray*" style "murrine-panel" -widget_class "*computertemp*" style "murrine-panel" -widget_class "*Applet*Tomboy*" style "murrine-panel" -widget_class "*Applet*Netstatus*" style "murrine-panel" -widget "*gdm-user-switch-menubar*" style "murrine-panel" - -style "bold-panel-item" { - font_name = "Bold" - - engine "murrine" { - roundness = 0 - } -} - -widget "*Panel*MenuBar*" style "bold-panel-item" -widget "*gimmie*" style "bold-panel-item" - -# widget_class "*Mail*" style "murrine-panel" # Disabled to fix Evolution bug -# class "*Panel*" style "murrine-panel" # Disabled to fix bug - -# XFCE Styles - -style "workspace-switcher" = "murrine-panel" { - bg[SELECTED] = @selected_bg_color -} - -style "xfce-header" { - bg[NORMAL] = shade (0.9, @bg_color) - base[NORMAL] = shade (1.18, @bg_color) -} - -style "xfdesktop-windowlist" { - bg[NORMAL] = @base_color - fg[INSENSITIVE] = shade (0.95, @base_color) - text[INSENSITIVE] = shade (0.95, @base_color) -} - -style "xfdesktop-icon-view" { - XfdesktopIconView::label-alpha = 0 - XfdesktopIconView::selected-label-alpha = 60 - XfdesktopIconVIew::ellipsize-icon-labels = 1 - - base[NORMAL] = @selected_bg_color - base[SELECTED] = @selected_bg_color - base[ACTIVE] = @selected_bg_color - - fg[NORMAL] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - - engine "murrine" { - textstyle = 5 - text_shade = 0.05 - } -} - -style "xfwm-tabwin" { - Xfwm4TabwinWidget::border-width = 0 - Xfwm4TabwinWidget::icon-size = 64 - - bg[NORMAL] = @menu_bg_color - fg[NORMAL] = @menu_fg_color - - engine "murrine" { - focusstyle = 0 - } -} - -style "xfsm-logout" { - bg[NORMAL] = @menu_bg_color - bg[ACTIVE] = @menu_bg_color - bg[PRELIGHT] = shade (1.1, @menu_bg_color) - bg[SELECTED] = shade (0.5, @menu_bg_color) - bg[INSENSITIVE] = shade (1.3, @menu_bg_color) - - fg[NORMAL] = @menu_fg_color - fg[PRELIGHT] = @menu_fg_color - - text[NORMAL] = @menu_fg_color - - engine "murrine" { - } -} - -style "xfsm-logout-button" { - bg[NORMAL] = shade (1.2, @menu_bg_color) - bg[PRELIGHT] = shade (1.4, @menu_bg_color) - - engine "murrine" { - } -} - -widget "*WnckPager*" style "workspace-switcher" - -widget "*Xfce*Panel*" style "murrine-panel" -class "*Xfce*Panel*" style "murrine-panel" - -# Thunar Styles - -style "sidepane" { - base[NORMAL] = @bg_color - base[INSENSITIVE] = mix (0.4, shade (1.35, @selected_bg_color), shade (0.9, @base_color)) - bg[NORMAL] = @bg_color - text[NORMAL] = mix (0.9, @fg_color, @bg_color) -} - -widget_class "*ThunarShortcutsView*" style "sidepane" -widget_class "*ThunarTreeView*" style "sidepane" -widget_class "*ThunarLocationEntry*" style "murrine-entry" - -# Gtk2 Open-File Dialog - -widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.GtkTreeView*" style "sidepane" -widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.." style "murrine-treeview-header" - -# Google Chrome/Chromium Styles (requires 9.0.597 or newer) - -style "chromium-toolbar-button" { - engine "murrine" { - roundness = 2 - textstyle = 0 - } -} - -style "chrome-gtk-frame" { - ChromeGtkFrame::frame-color = @titlebar_bg_color - ChromeGtkFrame::inactive-frame-color = @titlebar_bg_color - - ChromeGtkFrame::frame-gradient-size = 0 - ChromeGtkFrame::frame-gradient-color = @titlebar_bg_color - - ChromeGtkFrame::incognito-frame-color = @titlebar_bg_color - ChromeGtkFrame::incognito-inactive-frame-color = @titlebar_bg_color - - ChromeGtkFrame::incognito-frame-gradient-size = 0 - ChromeGtkFrame::incognito-frame-gradient-color = @titlebar_bg_color - - ChromeGtkFrame::scrollbar-trough-color = @bg_color - ChromeGtkFrame::scrollbar-slider-normal-color = mix (0.21, @fg_color, @bg_color) - ChromeGtkFrame::scrollbar-slider-prelight-color = mix (0.31, @fg_color, @bg_color) -} - -class "ChromeGtkFrame" style "chrome-gtk-frame" - -widget_class "*Chrom*Button*" style "chromium-toolbar-button" - -# General Styles - -class "GtkWidget" style "murrine-default" - -class "GtkFrame" style "murrine-wide" -class "MetaFrames" style "metacity-frame" -class "GtkWindow" style "metacity-frame" - -class "GtkSeparator" style "murrine-wide" -class "GtkCalendar" style "murrine-wide" - -class "GtkSpinButton" style "murrine-spinbutton" - -class "GtkScale" style "murrine-scale" -class "GtkVScale" style "murrine-vscale" -class "GtkHScale" style "murrine-hscale" -class "GtkScrollbar" style "murrine-scrollbar" -class "GtkVScrollbar" style "murrine-vscrollbar" -class "GtkHScrollbar" style "murrine-hscrollbar" - -class "GtkRadio*" style "murrine-radiocheck" -class "GtkCheck*" style "murrine-radiocheck" - -class "GtkEntry" style "murrine-entry" - -widget_class "*" style "murrine-notebook" -widget_class "**" style "murrine-notebook-bg" -widget_class "**" style "murrine-notebook-bg" -widget_class "**" style "murrine-notebook-bg" -widget_class "*.GtkNotebook.*.GtkViewport" style "murrine-notebook" - -widget_class "*" style "murrine-button" -widget_class "**" style "murrine-statusbar" -widget_class "*" style "murrine-progressbar" -widget_class "*" style "murrine-progressbar" - -widget_class "**" style "murrine-comboboxentry" -widget_class "**" style "murrine-comboboxentry" - -widget_class "**" style "murrine-menu" -widget_class "**" style "murrine-menu-item" -widget_class "**" style "murrine-separator-menu-item" -widget_class "*Menu*.*Sepa*" style "murrine-separator-menu-item" -widget_class "**" style "murrine-menubar" -widget_class "***" style "murrine-menubaritem" - -widget_class "*GtkToolButton*" style "murrine-toolbutton" -widget_class "*GtkToggleToolButton*" style "murrine-toolbutton" -widget_class "*GtkMenuToolButton*" style "murrine-toolbutton" -widget_class "*GtkToolbar*Button" style "murrine-toolbutton" - -widget_class "*.." style "murrine-frame-title" - -widget_class "*.*" style "murrine-treeview" -widget_class "*.." style "murrine-treeview-header" -widget_class "*.." style "murrine-treeview-header" -widget_class "*.." style "murrine-treeview-header" -widget_class "*.." style "murrine-treeview-header" - -widget "gtk-tooltip*" style "murrine-tooltips" - -widget_class "**" style "murrine-overlay-scrollbar" - -# Workarounds and Non-Standard Styling - -style "text-is-fg-color-workaround" { - text[NORMAL] = @text_color - text[PRELIGHT] = @fg_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @fg_color - text[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) -} - -widget_class "*.." style "text-is-fg-color-workaround" - -style "fg-is-text-color-workaround" { - fg[NORMAL] = @text_color - fg[PRELIGHT] = @text_color - fg[ACTIVE] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[INSENSITIVE] = darker (@fg_color) -} - -widget_class "**" style "fg-is-text-color-workaround" -widget_class "*" style "fg-is-text-color-workaround" -widget_class "*" style "fg-is-text-color-workaround" - -style "murrine-evo-new-button-workaround" { - engine "murrine" { - toolbarstyle = 0 - } -} - -widget_class "EShellWindow.GtkVBox.BonoboDock.BonoboDockBand.BonoboDockItem*" style "murrine-evo-new-button-workaround" - -style "inkscape-toolbar-fix" { - engine "murrine" { - gradient_shades = { 1.0, 1.0, 1.0, 1.0 } - highlight_shade = 1.0 - } -} - -#widget "*GtkHandleBox*" style "inkscape-toolbar-fix" -#widget "*HandleBox*CommandsToolbar*" style "inkscape-toolbar-fix" -#widget "*HandleBox*SnapToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*SelectToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*NodeToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*TweakToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ZoomToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*StarToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*RectToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*3DBoxToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ArcToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*SpiralToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PencilToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PenToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*CalligraphyToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*EraserToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*LPEToolToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*DropperToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ConnectorToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PaintbucketToolbar*" style "inkscape-toolbar-fix" - -# Performance Fixes - -style "performance-fix" { - engine "murrine" { - textstyle = 0 - } -} - -widget_class "*gtkmm__GtkWindow*" style "performance-fix" # Inkscape -widget_class "*GimpDisplayShell*" style "performance-fix" # Gimp -widget_class "*GimpToolbox*" style "performance-fix" -widget_class "*GimpMenuDock*" style "performance-fix" -widget "*OOoFixed*" style "performance-fix" # Openoffice/Libreoffice -widget_class "*MozContainer*" style "performance-fix" # Firefox (Not sure if this one does anything though.) - -widget_class "*XfceHeading*" style "xfce-header" -widget_class "*XfceDesktop*" style "xfdesktop-windowlist" -widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view" -widget "xfwm4-tabwin*" style "xfwm-tabwin" -widget_class "*XfsmLogoutDialog*" style "xfsm-logout" -widget_class "*XfsmLogoutDialog*GtkButton" style "xfsm-logout-button" - - diff --git a/themes/scanner/testdata/Themes/Gtk1/gtk-3.0/settings.ini b/themes/scanner/testdata/Themes/Gtk1/gtk-3.0/settings.ini deleted file mode 100644 index 9aa01e55..00000000 --- a/themes/scanner/testdata/Themes/Gtk1/gtk-3.0/settings.ini +++ /dev/null @@ -1,3 +0,0 @@ -[Settings] -gtk-auto-mnemonics = 1 -gtk-visible-focus = automatic diff --git a/themes/scanner/testdata/Themes/Gtk1/index.theme b/themes/scanner/testdata/Themes/Gtk1/index.theme deleted file mode 100644 index 123b925b..00000000 --- a/themes/scanner/testdata/Themes/Gtk1/index.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 diff --git a/themes/scanner/testdata/Themes/Gtk1/metacity-1/metacity-theme-3.xml b/themes/scanner/testdata/Themes/Gtk1/metacity-1/metacity-theme-3.xml deleted file mode 100644 index 69604411..00000000 --- a/themes/scanner/testdata/Themes/Gtk1/metacity-1/metacity-theme-3.xml +++ /dev/null @@ -1,1586 +0,0 @@ - - - - Deepin - Satyajit Sahoo - GPL-3.0+ - 11 December 2013 - Numix Mutter Theme - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <title version=">= 3.1" - x="(0 `max` ((frame_x_center - title_width/2) `min` (width - title_width))) + 2" - y="(0 `max` ((height - title_height) / 2))" - ellipsize_width="width" - color="C_title_focused" /> -</draw_ops> - -<draw_ops name="title_unfocused"> - <title version="< 3.1" - x="(0 `max` ((width - title_width) / 2)) + 2" - y="(0 `max` ((height - title_height) / 2))" - color="C_title_unfocused" /> - <title version=">= 3.1" - x="(0 `max` ((frame_x_center - title_width/2) `min` (width - title_width))) + 2" - y="(0 `max` ((height - title_height) / 2))" - ellipsize_width="width" - color="C_title_unfocused" /> -</draw_ops> - -<!-- ::: WINDOW DECORATIONS ::: --> -<draw_ops name="entire_background_focused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="entire_background_unfocused"> - <include name="entire_background_focused" /> -</draw_ops> - -<draw_ops name="titlebar_fill_focused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="titlebar_fill_attached_focused"> - <include name="entire_background_focused" /> -</draw_ops> - -<draw_ops name="titlebar_fill_unfocused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="titlebar_focused"> - <include name="titlebar_fill_focused" /> -</draw_ops> - -<draw_ops name="titlebar_attached_focused"> <!-- titlebar for attached and modal dialogs --> - <include name="titlebar_fill_attached_focused" /> -</draw_ops> - -<draw_ops name="rounded_titlebar_focused"> - <include name="titlebar_fill_focused" /> -</draw_ops> - -<draw_ops name="border_focused"> - <rectangle color="C_border_focused" x="0" y="0" width="width-1" height="height-1" filled="false" /> -</draw_ops> - -<draw_ops name="border_unfocused"> - <rectangle color="C_border_unfocused" x="0" y="0" width="width-1" height="height-1" filled="false" /> -</draw_ops> - -<draw_ops name="rounded_border_focused"> - <line color="C_border_focused" x1="2" y1="0" x2="width-3" y2="0" /> - <line color="C_border_focused" x1="0" y1="height-1" x2="width-1" y2="height-1" /> - <line color="C_border_focused" x1="0" y1="2" x2="0" y2="height-2" /> - <line color="C_border_focused" x1="width-1" y1="2" x2="width-1" y2="height-2" /> - <arc color="C_border_focused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_focused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> - <!-- double arcs for darker borders --> - <arc color="C_border_focused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_focused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> -</draw_ops> - -<draw_ops name="rounded_border_unfocused"> - <line color="C_border_unfocused" x1="2" y1="0" x2="width-3" y2="0" /> - <line color="C_border_unfocused" x1="0" y1="height-1" x2="width-1" y2="height-1" /> - <line color="C_border_unfocused" x1="0" y1="2" x2="0" y2="height-2" /> - <line color="C_border_unfocused" x1="width-1" y1="2" x2="width-1" y2="height-2" /> - <arc color="C_border_unfocused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_unfocused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> - <!-- double arcs for darker borders --> - <arc color="C_border_unfocused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_unfocused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> -</draw_ops> - -<draw_ops name="border_right_focused"> - <line - x1="width-1" y1="0" - x2="width-1" y2="height" - color="C_border_focused" /> -</draw_ops> - -<draw_ops name="border_right_unfocused"> - <line - x1="width-1" y1="0" - x2="width-1" y2="height" - color="C_border_unfocused" /> -</draw_ops> - -<draw_ops name="border_left_focused"> - <line - x1="0" y1="0" - x2="0" y2="height" - color="C_border_focused" /> -</draw_ops> - -<draw_ops name="border_left_unfocused"> - <line - x1="0" y1="0" - x2="0" y2="height" - color="C_border_unfocused" /> -</draw_ops> - -<!-- ::: BUTTON ICONS ::: --> -<!-- note: negative values in x or y causes gnome-shell to crash --> -<!-- close icon --> -<draw_ops name="close_focused"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="close_focused_prelight"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="close_focused_pressed"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="close_unfocused"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="close_unfocused_prelight"> - <include name="close_focused_prelight" /> -</draw_ops> - -<draw_ops name="close_unfocused_pressed"> - <include name="close_focused_pressed" /> -</draw_ops> - -<!-- maximize icon --> -<draw_ops name="maximize_focused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="maximize_focused_prelight"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="maximize_focused_pressed"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="maximize_unfocused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="maximize_unfocused_prelight"> - <include name="maximize_focused_prelight" /> -</draw_ops> - -<draw_ops name="maximize_unfocused_pressed"> - <include name="maximize_focused_pressed" /> -</draw_ops> - -<!-- unmaximize icon --> -<draw_ops name="unmaximize_focused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="unmaximize_focused_prelight"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="unmaximize_focused_pressed"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused_prelight"> - <include name="unmaximize_focused_prelight" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused_pressed"> - <include name="unmaximize_focused_pressed" /> -</draw_ops> - -<!-- minimize icon --> -<draw_ops name="minimize_focused"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="minimize_focused_prelight"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="minimize_focused_pressed"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="minimize_unfocused"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="minimize_unfocused_prelight"> - <include name="minimize_focused_prelight" /> -</draw_ops> - -<draw_ops name="minimize_unfocused_pressed"> - <include name="minimize_focused_pressed" /> -</draw_ops> - -<!-- menu icon --> -<draw_ops name="menu_focused"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="menu_focused_prelight"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="menu_focused_pressed"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="menu_unfocused"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="menu_unfocused_prelight"> - <include name="menu_focused_prelight" /> -</draw_ops> - -<draw_ops name="menu_unfocused_pressed"> - <include name="menu_focused_pressed" /> -</draw_ops> - -<!-- shade icon --> -<draw_ops name="shade_focused"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="shade_focused_prelight"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="shade_focused_pressed"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="shade_unfocused"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="shade_unfocused_prelight"> - <include name="shade_focused_prelight" /> -</draw_ops> - -<draw_ops name="shade_unfocused_pressed"> - <include name="shade_focused_pressed" /> -</draw_ops> - -<!-- unshade icon --> -<draw_ops name="unshade_focused"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="unshade_focused_prelight"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="unshade_focused_pressed"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="unshade_unfocused"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="unshade_unfocused_prelight"> - <include name="unshade_focused_prelight" /> -</draw_ops> - -<draw_ops name="unshade_unfocused_pressed"> - <include name="unshade_focused_pressed" /> -</draw_ops> - -<!-- ::: FRAME STYLES ::: --> -<frame_style name="normal_focused" geometry="normal"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="rounded_titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="rounded_border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_unfocused" geometry="normal_unfocused"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="rounded_border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_focused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_unfocused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_shaded_focused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay"><draw_ops><line x1="0" y1="height-1" x2="width" y2="height-1" color="C_border_focused" /></draw_ops></piece> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_shaded_unfocused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay"><draw_ops><line x1="0" y1="height-1" x2="width" y2="height-1" color="C_border_unfocused" /></draw_ops></piece> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="dialog_focused" geometry="nobuttons"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="rounded_titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="rounded_border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="dialog_unfocused" geometry="nobuttons"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="rounded_border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="modal_dialog_focused" geometry="modal"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button><button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="modal_dialog_unfocused" geometry="modal"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="utility_focused" geometry="small"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="utility_unfocused" geometry="small_unfocused"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="border_focused" geometry="border"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="border_unfocused" geometry="border"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="borderless" geometry="borderless"> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="attached_focused" geometry="attached"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="attached_unfocused" geometry="attached"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_left_focused" geometry="tiled_left"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_right_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_left_unfocused" geometry="tiled_left"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_right_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_right_focused" geometry="tiled_right"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_left_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_right_unfocused" geometry="tiled_right"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_left_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<!-- placeholder for unimplementated styles--> -<frame_style name="blank" geometry="normal"> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<!-- ::: FRAME STYLE SETS ::: --> -<frame_style_set name="normal_style_set"> - <frame focus="yes" state="normal" resize="both" style="normal_focused" /> - <frame focus="no" state="normal" resize="both" style="normal_unfocused" /> - <frame focus="yes" state="maximized" style="normal_max_focused" /> - <frame focus="no" state="maximized" style="normal_max_unfocused" /> - <frame focus="yes" state="shaded" style="normal_focused" /> - <frame focus="no" state="shaded" style="normal_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="normal_max_shaded_focused" /> - <frame focus="no" state="maximized_and_shaded" style="normal_max_shaded_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_left" style="tiled_left_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_left" style="tiled_left_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_right" style="tiled_right_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_right" style="tiled_right_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_left_and_shaded" style="tiled_left_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_left_and_shaded" style="tiled_left_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_right_and_shaded" style="tiled_right_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_right_and_shaded" style="tiled_right_unfocused" /> -</frame_style_set> - -<frame_style_set name="dialog_style_set"> - <frame focus="yes" state="normal" resize="both" style="dialog_focused" /> - <frame focus="no" state="normal" resize="both" style="dialog_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="dialog_focused" /> - <frame focus="no" state="shaded" style="dialog_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="modal_dialog_style_set"> - <frame focus="yes" state="normal" resize="both" style="modal_dialog_focused" /> - <frame focus="no" state="normal" resize="both" style="modal_dialog_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="modal_dialog_focused" /> - <frame focus="no" state="shaded" style="modal_dialog_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="utility_style_set"> - <frame focus="yes" state="normal" resize="both" style="utility_focused" /> - <frame focus="no" state="normal" resize="both" style="utility_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="utility_focused" /> - <frame focus="no" state="shaded" style="utility_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="border_style_set"> - <frame focus="yes" state="normal" resize="both" style="border_focused" /> - <frame focus="no" state="normal" resize="both" style="border_unfocused" /> - <frame focus="yes" state="maximized" style="borderless" /> - <frame focus="no" state="maximized" style="borderless" /> - <frame focus="yes" state="shaded" style="blank" /> - <frame focus="no" state="shaded" style="blank" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="attached_style_set"> - <frame focus="yes" state="normal" resize="both" style="attached_focused" /> - <frame focus="no" state="normal" resize="both" style="attached_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="blank" /> - <frame focus="no" state="shaded" style="blank" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<!-- ::: WINDOWS ::: --> -<window type="normal" style_set="normal_style_set" /> -<window type="dialog" style_set="dialog_style_set" /> -<window type="modal_dialog" style_set="modal_dialog_style_set" /> -<window type="menu" style_set="utility_style_set" /> -<window type="utility" style_set="utility_style_set" /> -<window type="border" style_set="border_style_set" /> -<window version=">= 3.2" type="attached" style_set="attached_style_set" /> - -</metacity_theme> diff --git a/themes/scanner/testdata/Themes/Gtk2/cursors/left_ptr b/themes/scanner/testdata/Themes/Gtk2/cursors/left_ptr deleted file mode 100644 index 61f968ef..00000000 Binary files a/themes/scanner/testdata/Themes/Gtk2/cursors/left_ptr and /dev/null differ diff --git a/themes/scanner/testdata/Themes/Gtk2/gtk-2.0/gtkrc b/themes/scanner/testdata/Themes/Gtk2/gtk-2.0/gtkrc deleted file mode 100644 index 4936bf92..00000000 --- a/themes/scanner/testdata/Themes/Gtk2/gtk-2.0/gtkrc +++ /dev/null @@ -1,786 +0,0 @@ -# Numix GTK Theme - -gtk-color-scheme = "bg_color:#fdfdfd\nfg_color:#282828\nbase_color:#ffffff\ntext_color:#333333\nselected_bg_color:#2CA7F8\nselected_fg_color:#f9f9f9\ntooltip_bg_color:#2d2d2d\ntooltip_fg_color:#dedede\ntitlebar_bg_color:#252627\ntitlebar_fg_color:#dcdcdc\nmenubar_bg_color:#252627\nmenubar_fg_color:#dcdcdc\ntoolbar_bg_color:#dedede\ntoolbar_fg_color:#555555\nmenu_bg_color:#2d2d2d\nmenu_fg_color:#dcdcdc\npanel_bg_color:#252627\npanel_fg_color:#dcdcdc\nlink_color:#007aff" - -# Default Style - -style "murrine-default" { - GtkArrow::arrow-scaling= 0.6 - - GtkButton::child-displacement-x = 0 - GtkButton::child-displacement-y = 0 - - GtkButton::default-border = { 0, 0, 0, 0 } - - GtkButtonBox::child-min-height = 26 - - GtkCheckButton::indicator-size = 16 - - # The following line hints to gecko (and possibly other appliations) - # that the entry should be drawn transparently on the canvas. - # Without this, gecko will fill in the background of the entry. - GtkEntry::honors-transparent-bg-hint = 1 - GtkEntry::state-hint = 0 - - GtkExpander::expander-size = 16 - - GtkImage::x-ayatana-indicator-dynamic = 1 - - GtkMenu::horizontal-padding = 0 - GtkMenu::vertical-padding = 0 - - GtkMenuBar::internal-padding = 0 - GtkMenuBar::window-dragging = 1 - - GtkMenuItem::arrow-scaling= 0.5 - - GtkPaned::handle-size = 1 - - GtkProgressBar::min-horizontal-bar-height = 12 - GtkProgressBar::min-vertical-bar-width = 12 - - GtkRange::trough-border = 0 - GtkRange::slider-width = 12 - GtkRange::stepper-size = 12 - GtkRange::stepper_spacing = 0 - GtkRange::trough-under-steppers = 1 - - GtkScale::slider-length = 16 - GtkScale::slider-width = 16 - GtkScale::trough-side-details = 1 - - GtkScrollbar::activate-slider = 1 - GtkScrollbar::has-backward-stepper = 0 - GtkScrollbar::has-forward-stepper = 0 - GtkScrollbar::has-secondary-backward-stepper = 0 - GtkScrollbar::has-secondary-forward-stepper = 0 - GtkScrollbar::min-slider-length = 80 - GtkScrollbar::slider-width = 4 - GtkScrollbar::trough-border = 0 - - GtkScrolledWindow::scrollbar-spacing = 0 - GtkScrolledWindow::scrollbars-within-bevel = 1 - - GtkSeparatorMenuItem::horizontal-padding = 0 - - GtkToolbar::internal-padding = 0 - - GtkTreeView::expander-size = 11 - GtkTreeView::vertical-separator = 0 - - GtkWidget::focus-line-width = 1 - # The following line prevents the Firefox tabs - # from jumping a few pixels when you create a new tab - GtkWidget::focus-padding = 0 - - GtkWidget::wide-separators = 1 - GtkWidget::separator-width = 1 - GtkWidget::separator-height = 1 - - GtkWindow::resize-grip-height = 0 - GtkWindow::resize-grip-width = 0 - - WnckTasklist::fade-overlay-rect = 0 - - GnomeHRef::link_color = @link_color - GtkHTML::link-color = @link_color - GtkIMHtmlr::hyperlink-color = @link_color - GtkIMHtml::hyperlink-color = @link_color - GtkWidget::link-color = @link_color - GtkWidget::visited-link-color = @text_color - - GtkToolbar::shadow-type = GTK_SHADOW_NONE # Makes toolbars flat and unified - GtkMenuBar::shadow-type = GTK_SHADOW_NONE # Makes menubars flat and unified - - xthickness = 1 - ythickness = 1 - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - bg[NORMAL] = @bg_color - bg[PRELIGHT] = shade (1.02, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.9, @bg_color) - bg[INSENSITIVE] = @bg_color - - base[NORMAL] = @base_color - base[PRELIGHT] = shade (0.95, @base_color) - base[SELECTED] = @selected_bg_color - base[ACTIVE] = @selected_bg_color - base[INSENSITIVE] = shade (0.85, @base_color) - - text[NORMAL] = @text_color - text[PRELIGHT] = @text_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @selected_fg_color - text[INSENSITIVE] = mix (0.5, @base_color, @text_color) - - engine "murrine" { - animation = FALSE - arrowstyle = 1 # 0 = normal arrows, 1 = filled arrows - border_shades = { 1.0, 1.0 } # gradient to draw on border - colorize_scrollbar = FALSE - comboboxstyle = 0 # 0 = normal combobox, 1 = colorized combobox below arrow - contrast = 0.8 # overal contrast with borders - focusstyle = 1 # 0 = none, 1 = grey dotted, 2 = colored with fill, 3 = colored glow - glazestyle = 0 # 0 = flat highlight, 1 = curved highlight, 2 = concave, 3 = top curved highlight, 4 = beryl highlight - glowstyle = 0 # 0 = glow on top, 1 = glow on bottom, 2 = glow on top and bottom, 3 = glow on middle vertically, 4 = glow on middle horizontally, 5 = glow on all sides - glow_shade = 1.0 # amount of glow - gradient_shades = { 1.0, 1.0, 1.0, 1.0 } # gradient to draw on widgets - highlight_shade = 1.0 # amount of highlight - lightborder_shade = 1.0 # amount of inset light border - lightborderstyle = 1 # 0 = lightborder on top side, 1 = lightborder on all sides - listviewheaderstyle = 0 # 0 = flat, 1 = glassy, 2 = raised - listviewstyle = 0 # 0 = none, 1 = dotted, 2 = line - menubaritemstyle = 0 # 0 = menuitem look, 1 = button look - menubarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient, 3 = striped - menuitemstyle = 0 # 0 = flat, 1 = glassy, 2 = striped - menustyle = 0 # 0 = none, 1 = vertical striped - progressbarstyle = 0 # 0 = none, 1 = diagonal striped, 2 = vertical striped - reliefstyle = 0 # 0 = flat, 1 = inset, 2 = shadow, 3 = shadow with gradient, 4 = stronger shadow with gradient - roundness = 2 # roundness of widgets - scrollbarstyle = 0 # 0 = none, 1 = circles, 2 = handles, 3 = diagonal stripes, 4 = diagonal stripes and handles, 5 = horizontal stripes, 6 = horizontal stripes and handles - sliderstyle = 0 # 0 = none, 1 = handles - stepperstyle = 1 # 0 = standard, 1 = integrated stepper handles - toolbarstyle = 0 # 0 = flat, 1 = glassy, 2 = gradient - } -} - -style "murrine-wide" { - xthickness = 2 - ythickness = 2 -} - -style "murrine-wider" { - xthickness = 3 - ythickness = 3 -} - -style "murrine-thin" { - xthickness = 0 - ythickness = 0 -} - -# Notebook - -style "murrine-notebook-bg" { - bg[NORMAL] = @base_color - bg[ACTIVE] = shade (0.87, @base_color) -} - -style "murrine-notebook" = "murrine-notebook-bg" { - xthickness = 2 - ythickness = 2 - - engine "murrine" { - roundness = 2 - } -} - -# Various Standard Widgets - -style "murrine-button" = "murrine-wider" { - xthickness = 3 - ythickness = 3 - - bg[NORMAL] = shade (0.96, @base_color) - bg[PRELIGHT] = "#9ad7ff" - bg[ACTIVE] = "#68c3ff" - bg[INSENSITIVE] = shade (0.95, @bg_color) - - fg[NORMAL] = shade (0.95, @fg_color) - - engine "murrine" { - contrast = 0.85 - roundness = 3 - gradient_shades = {1.05,1.0,1.0,0.98} - border_shades = {1.10, 0.95} - - lightborderstyle = 1 # 0 = top side, 1 = all sides - lightborder_shade = 1.3 - highlight_shade = 1.03 - focusstyle = 0 - glowstyle = 0 # 0 = top, 1 = bottom, 2 = top and bottom, 3 = horizontal, 4 = centered glow - glow_shade = 1.05 - reliefstyle = 3 - textstyle = 1 - text_shade = 1.2 - } -} - -style "murrine-scrollbar" { - bg[NORMAL] = mix (0.21, @fg_color, @bg_color) - bg[PRELIGHT] = mix (0.31, @fg_color, @bg_color) - bg[ACTIVE] = @selected_bg_color - - engine "murrine" { - roundness = 0 - contrast = 0.0 - border_shades = { 0.9, 0.9 } - trough_shades = { 0.97, 0.97 } - trough_border_shades = { 1.0, 1.0 } - } -} - -style "murrine-overlay-scrollbar" { - bg[ACTIVE] = shade (0.8, @bg_color) - bg[INSENSITIVE] = shade (0.97, @bg_color) - - base[SELECTED] = shade (0.6, @base_color) - base[INSENSITIVE] = shade (0.85, @base_color) -} - -style "murrine-scale" = "murrine-thin" { - bg[NORMAL] = @bg_color - bg[ACTIVE] = @bg_color - bg[SELECTED] = @selected_bg_color - bg[INSENSITIVE] = shade (0.95, @bg_color) - - engine "murrine" { - roundness = 8 - gradient_shades = { 1.08, 1.08, 1.08, 1.08 } - border_shades = { 1.0, 1.0 } - trough_shades = { 1.08, 1.08 } - trough_border_shades = { 0.8, 0.8 } - } -} - -style "murrine-progressbar" = "murrine-thin" { - bg[NORMAL] = @bg_color - bg[ACTIVE] = shade (1.08, @bg_color) - - fg[PRELIGHT] = @selected_fg_color - - engine "murrine" { - roundness = 3 - border_shades = { 1.2, 1.2 } - trough_border_shades = { 0.9, 0.9 } - } -} - -style "murrine-treeview-header" = "murrine-button" { - engine "murrine" { - roundness = 0 - } -} - -style "murrine-treeview" { - engine "murrine" { - roundness = 0 - } -} - -style "murrine-frame-title" { - fg[NORMAL] = lighter (@fg_color) -} - -style "murrine-tooltips" { - xthickness = 5 - ythickness = 5 - - bg[NORMAL] = @tooltip_bg_color - bg[SELECTED] = @tooltip_bg_color - - fg[NORMAL] = @tooltip_fg_color - - engine "murrine" { - textstyle = 0 - roundness = 2 - rgba = FALSE - } -} - -style "murrine-spinbutton" = "murrine-button" { - engine "murrine" { - } -} - -style "murrine-radiocheck" = "murrine-default" { - bg[NORMAL] = @base_color - bg[PRELIGHT] = "#9ad7ff" - bg[SELECTED] = @base_color - - text[NORMAL] = @text_color - text[PRELIGHT] = @text_color -} - -style "murrine-entry" = "murrine-wider" { - engine "murrine" { - border_shades = { 1.15, 1.15 } - } -} - -style "metacity-frame" = "murrine-default" { - bg[SELECTED] = @selected_bg_color -} - -style "murrine-statusbar" { } -style "murrine-comboboxentry" = "murrine-entry" { } -style "murrine-hscale" = "murrine-scale" { } -style "murrine-vscale" = "murrine-scale" { } -style "murrine-hscrollbar" = "murrine-scrollbar" { } -style "murrine-vscrollbar" = "murrine-scrollbar" { } - -# Menus - -style "murrine-menu" = "murrine-thin" { - bg[NORMAL] = @menu_bg_color - bg[PRELIGHT] = @selected_bg_color - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = @menu_bg_color - bg[INSENSITIVE] = @menu_bg_color - - fg[NORMAL] = @menu_fg_color - fg[PRELIGHT] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - text[NORMAL] = @menu_fg_color - text[PRELIGHT] = @selected_fg_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @selected_fg_color - text[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -style "murrine-menu-item" = "murrine-wider" { - bg[PRELIGHT] = @selected_bg_color - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = @selected_bg_color - - fg[NORMAL] = @menu_fg_color # Fix for XFCE menu text - fg[PRELIGHT] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - fg[INSENSITIVE] = mix (0.5, @menu_bg_color, @menu_fg_color) - - engine "murrine" { - textstyle = 0 - border_shades = { 1.2, 1.2 } - } -} - -style "murrine-separator-menu-item" = "murrine-thin" { } - -style "murrine-menubar" { - bg[NORMAL] = @menubar_bg_color - bg[PRELIGHT] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[SELECTED] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[ACTIVE] = shade (0.9, @menubar_bg_color) - bg[INSENSITIVE] = @menubar_bg_color - - fg[NORMAL] = @menubar_fg_color - fg[PRELIGHT] = shade (1.08, @menubar_fg_color) - fg[SELECTED] = shade (1.08, @menubar_fg_color) - fg[ACTIVE] = @menubar_fg_color - fg[INSENSITIVE] = mix (0.5, @menubar_bg_color, @menubar_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -style "murrine-menubaritem" { - bg[NORMAL] = @menubar_bg_color - bg[PRELIGHT] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[SELECTED] = mix (0.21, @menubar_fg_color, @menubar_bg_color) - bg[ACTIVE] = shade (0.9, @menubar_bg_color) - bg[INSENSITIVE] = @menubar_bg_color - - fg[NORMAL] = @menubar_fg_color - fg[PRELIGHT] = shade (1.08, @menubar_fg_color) - fg[SELECTED] = shade (1.08, @menubar_fg_color) - fg[ACTIVE] = @menubar_fg_color - fg[INSENSITIVE] = mix (0.5, @menubar_bg_color, @menubar_fg_color) - - engine "murrine" { - roundness = 0 - } -} - -# Toolbars - -style "murrine-toolbar" = "murrine-thin" { - bg[NORMAL] = @base_color - bg[PRELIGHT] = shade (1.02, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.9, @bg_color) - bg[INSENSITIVE] = @bg_color - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - engine "murrine" { - } -} - -style "murrine-toolbutton" = "murrine-button" { - bg[NORMAL] = shade (1.08, @bg_color) - bg[PRELIGHT] = shade (1.10, @bg_color) - bg[SELECTED] = @selected_bg_color - bg[ACTIVE] = shade (0.95, @bg_color) - bg[INSENSITIVE] = shade (0.85, @bg_color) - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @fg_color - fg[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) - - engine "murrine" { - } -} - -class "GtkToolbar" style "murrine-toolbar" -class "GtkHandleBox" style "murrine-toolbar" -widget_class "*Toolbar*.*Separator*" style "murrine-toolbar" - -# Panels - -style "murrine-panel" = "murrine-thin" { - xthickness = 2 - - bg[NORMAL] = @panel_bg_color - bg[PRELIGHT] = mix (0.21, @panel_fg_color, @panel_bg_color) - bg[SELECTED] = mix (0.21, @panel_fg_color, @panel_bg_color) - bg[ACTIVE] = shade (0.8, @panel_bg_color) - bg[INSENSITIVE] = @panel_bg_color - - fg[NORMAL] = @panel_fg_color - fg[PRELIGHT] = shade (1.08, @panel_fg_color) - fg[SELECTED] = shade (1.08, @panel_fg_color) - fg[ACTIVE] = @panel_fg_color - fg[INSENSITIVE] = mix (0.5, @panel_bg_color, @panel_fg_color) - - base[NORMAL] = @panel_bg_color - base[PRELIGHT] = mix (0.21, @panel_fg_color, @panel_bg_color) - base[SELECTED] = mix (0.21, @panel_fg_color, @panel_bg_color) - base[ACTIVE] = shade (0.9, @panel_bg_color) - base[INSENSITIVE] = @panel_bg_color - - text[NORMAL] = @panel_fg_color - text[PRELIGHT] = shade (1.08, @panel_fg_color) - text[SELECTED] = shade (1.08, @panel_fg_color) - text[ACTIVE] = @panel_fg_color - text[INSENSITIVE] = mix (0.5, @panel_bg_color, @panel_fg_color) - - engine "murrine" { - roundness = 0 - contrast = 0.0 - } -} - -widget "*PanelWidget*" style "murrine-panel" -widget "*PanelApplet*" style "murrine-panel" -widget "*fast-user-switch*" style "murrine-panel" -widget "*CPUFreq*Applet*" style "murrine-panel" -widget "*indicator-applet*" style "murrine-panel" -class "PanelApp*" style "murrine-panel" -class "PanelToplevel*" style "murrine-panel" -widget_class "*PanelToplevel*" style "murrine-panel" -widget_class "*notif*" style "murrine-panel" -widget_class "*Notif*" style "murrine-panel" -widget_class "*Tray*" style "murrine-panel" -widget_class "*tray*" style "murrine-panel" -widget_class "*computertemp*" style "murrine-panel" -widget_class "*Applet*Tomboy*" style "murrine-panel" -widget_class "*Applet*Netstatus*" style "murrine-panel" -widget "*gdm-user-switch-menubar*" style "murrine-panel" - -style "bold-panel-item" { - font_name = "Bold" - - engine "murrine" { - roundness = 0 - } -} - -widget "*Panel*MenuBar*" style "bold-panel-item" -widget "*gimmie*" style "bold-panel-item" - -# widget_class "*Mail*" style "murrine-panel" # Disabled to fix Evolution bug -# class "*Panel*" style "murrine-panel" # Disabled to fix bug - -# XFCE Styles - -style "workspace-switcher" = "murrine-panel" { - bg[SELECTED] = @selected_bg_color -} - -style "xfce-header" { - bg[NORMAL] = shade (0.9, @bg_color) - base[NORMAL] = shade (1.18, @bg_color) -} - -style "xfdesktop-windowlist" { - bg[NORMAL] = @base_color - fg[INSENSITIVE] = shade (0.95, @base_color) - text[INSENSITIVE] = shade (0.95, @base_color) -} - -style "xfdesktop-icon-view" { - XfdesktopIconView::label-alpha = 0 - XfdesktopIconView::selected-label-alpha = 60 - XfdesktopIconVIew::ellipsize-icon-labels = 1 - - base[NORMAL] = @selected_bg_color - base[SELECTED] = @selected_bg_color - base[ACTIVE] = @selected_bg_color - - fg[NORMAL] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[ACTIVE] = @selected_fg_color - - engine "murrine" { - textstyle = 5 - text_shade = 0.05 - } -} - -style "xfwm-tabwin" { - Xfwm4TabwinWidget::border-width = 0 - Xfwm4TabwinWidget::icon-size = 64 - - bg[NORMAL] = @menu_bg_color - fg[NORMAL] = @menu_fg_color - - engine "murrine" { - focusstyle = 0 - } -} - -style "xfsm-logout" { - bg[NORMAL] = @menu_bg_color - bg[ACTIVE] = @menu_bg_color - bg[PRELIGHT] = shade (1.1, @menu_bg_color) - bg[SELECTED] = shade (0.5, @menu_bg_color) - bg[INSENSITIVE] = shade (1.3, @menu_bg_color) - - fg[NORMAL] = @menu_fg_color - fg[PRELIGHT] = @menu_fg_color - - text[NORMAL] = @menu_fg_color - - engine "murrine" { - } -} - -style "xfsm-logout-button" { - bg[NORMAL] = shade (1.2, @menu_bg_color) - bg[PRELIGHT] = shade (1.4, @menu_bg_color) - - engine "murrine" { - } -} - -widget "*WnckPager*" style "workspace-switcher" - -widget "*Xfce*Panel*" style "murrine-panel" -class "*Xfce*Panel*" style "murrine-panel" - -# Thunar Styles - -style "sidepane" { - base[NORMAL] = @bg_color - base[INSENSITIVE] = mix (0.4, shade (1.35, @selected_bg_color), shade (0.9, @base_color)) - bg[NORMAL] = @bg_color - text[NORMAL] = mix (0.9, @fg_color, @bg_color) -} - -widget_class "*ThunarShortcutsView*" style "sidepane" -widget_class "*ThunarTreeView*" style "sidepane" -widget_class "*ThunarLocationEntry*" style "murrine-entry" - -# Gtk2 Open-File Dialog - -widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.GtkTreeView*" style "sidepane" -widget_class "*GtkFileChooserWidget.GtkFileChooserDefault.GtkVBox.GtkHPaned.GtkVBox.GtkScrolledWindow.<GtkTreeView>.<GtkButton>" style "murrine-treeview-header" - -# Google Chrome/Chromium Styles (requires 9.0.597 or newer) - -style "chromium-toolbar-button" { - engine "murrine" { - roundness = 2 - textstyle = 0 - } -} - -style "chrome-gtk-frame" { - ChromeGtkFrame::frame-color = @titlebar_bg_color - ChromeGtkFrame::inactive-frame-color = @titlebar_bg_color - - ChromeGtkFrame::frame-gradient-size = 0 - ChromeGtkFrame::frame-gradient-color = @titlebar_bg_color - - ChromeGtkFrame::incognito-frame-color = @titlebar_bg_color - ChromeGtkFrame::incognito-inactive-frame-color = @titlebar_bg_color - - ChromeGtkFrame::incognito-frame-gradient-size = 0 - ChromeGtkFrame::incognito-frame-gradient-color = @titlebar_bg_color - - ChromeGtkFrame::scrollbar-trough-color = @bg_color - ChromeGtkFrame::scrollbar-slider-normal-color = mix (0.21, @fg_color, @bg_color) - ChromeGtkFrame::scrollbar-slider-prelight-color = mix (0.31, @fg_color, @bg_color) -} - -class "ChromeGtkFrame" style "chrome-gtk-frame" - -widget_class "*Chrom*Button*" style "chromium-toolbar-button" - -# General Styles - -class "GtkWidget" style "murrine-default" - -class "GtkFrame" style "murrine-wide" -class "MetaFrames" style "metacity-frame" -class "GtkWindow" style "metacity-frame" - -class "GtkSeparator" style "murrine-wide" -class "GtkCalendar" style "murrine-wide" - -class "GtkSpinButton" style "murrine-spinbutton" - -class "GtkScale" style "murrine-scale" -class "GtkVScale" style "murrine-vscale" -class "GtkHScale" style "murrine-hscale" -class "GtkScrollbar" style "murrine-scrollbar" -class "GtkVScrollbar" style "murrine-vscrollbar" -class "GtkHScrollbar" style "murrine-hscrollbar" - -class "GtkRadio*" style "murrine-radiocheck" -class "GtkCheck*" style "murrine-radiocheck" - -class "GtkEntry" style "murrine-entry" - -widget_class "*<GtkNotebook>" style "murrine-notebook" -widget_class "*<GtkNotebook>*<GtkEventBox>" style "murrine-notebook-bg" -widget_class "*<GtkNotebook>*<GtkDrawingArea>" style "murrine-notebook-bg" -widget_class "*<GtkNotebook>*<GtkLayout>" style "murrine-notebook-bg" -widget_class "*.GtkNotebook.*.GtkViewport" style "murrine-notebook" - -widget_class "*<GtkButton>" style "murrine-button" -widget_class "*<GtkStatusbar>*" style "murrine-statusbar" -widget_class "*<GtkProgress>" style "murrine-progressbar" -widget_class "*<GtkProgressBar>" style "murrine-progressbar" - -widget_class "*<GtkComboBoxEntry>*" style "murrine-comboboxentry" -widget_class "*<GtkCombo>*" style "murrine-comboboxentry" - -widget_class "*<GtkMenu>*" style "murrine-menu" -widget_class "*<GtkMenuItem>*" style "murrine-menu-item" -widget_class "*<GtkSeparatorMenuItem>*" style "murrine-separator-menu-item" -widget_class "*Menu*.*Sepa*" style "murrine-separator-menu-item" -widget_class "*<GtkMenuBar>*" style "murrine-menubar" -widget_class "*<GtkMenuBar>*<GtkMenuItem>*" style "murrine-menubaritem" - -widget_class "*GtkToolButton*" style "murrine-toolbutton" -widget_class "*GtkToggleToolButton*" style "murrine-toolbutton" -widget_class "*GtkMenuToolButton*" style "murrine-toolbutton" -widget_class "*GtkToolbar*Button" style "murrine-toolbutton" - -widget_class "*.<GtkFrame>.<GtkLabel>" style "murrine-frame-title" - -widget_class "*.<GtkTreeView>*" style "murrine-treeview" -widget_class "*.<GtkTreeView>.<GtkButton>" style "murrine-treeview-header" -widget_class "*.<GtkCTree>.<GtkButton>" style "murrine-treeview-header" -widget_class "*.<GtkList>.<GtkButton>" style "murrine-treeview-header" -widget_class "*.<GtkCList>.<GtkButton>" style "murrine-treeview-header" - -widget "gtk-tooltip*" style "murrine-tooltips" - -widget_class "*<GtkScrolledWindow>*<OsScrollbar>" style "murrine-overlay-scrollbar" - -# Workarounds and Non-Standard Styling - -style "text-is-fg-color-workaround" { - text[NORMAL] = @text_color - text[PRELIGHT] = @fg_color - text[SELECTED] = @selected_fg_color - text[ACTIVE] = @fg_color - text[INSENSITIVE] = mix (0.5, @bg_color, @fg_color) -} - -widget_class "*.<GtkComboBox>.<GtkCellView>" style "text-is-fg-color-workaround" - -style "fg-is-text-color-workaround" { - fg[NORMAL] = @text_color - fg[PRELIGHT] = @text_color - fg[ACTIVE] = @selected_fg_color - fg[SELECTED] = @selected_fg_color - fg[INSENSITIVE] = darker (@fg_color) -} - -widget_class "*<GtkListItem>*" style "fg-is-text-color-workaround" -widget_class "*<GtkCList>" style "fg-is-text-color-workaround" -widget_class "*<EelEditableLabel>" style "fg-is-text-color-workaround" - -style "murrine-evo-new-button-workaround" { - engine "murrine" { - toolbarstyle = 0 - } -} - -widget_class "EShellWindow.GtkVBox.BonoboDock.BonoboDockBand.BonoboDockItem*" style "murrine-evo-new-button-workaround" - -style "inkscape-toolbar-fix" { - engine "murrine" { - gradient_shades = { 1.0, 1.0, 1.0, 1.0 } - highlight_shade = 1.0 - } -} - -#widget "*GtkHandleBox*" style "inkscape-toolbar-fix" -#widget "*HandleBox*CommandsToolbar*" style "inkscape-toolbar-fix" -#widget "*HandleBox*SnapToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*SelectToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*NodeToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*TweakToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ZoomToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*StarToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*RectToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*3DBoxToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ArcToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*SpiralToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PencilToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PenToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*CalligraphyToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*EraserToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*LPEToolToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*DropperToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*ConnectorToolbar*" style "inkscape-toolbar-fix" -widget "*HandleBox*PaintbucketToolbar*" style "inkscape-toolbar-fix" - -# Performance Fixes - -style "performance-fix" { - engine "murrine" { - textstyle = 0 - } -} - -widget_class "*gtkmm__GtkWindow*" style "performance-fix" # Inkscape -widget_class "*GimpDisplayShell*" style "performance-fix" # Gimp -widget_class "*GimpToolbox*" style "performance-fix" -widget_class "*GimpMenuDock*" style "performance-fix" -widget "*OOoFixed*" style "performance-fix" # Openoffice/Libreoffice -widget_class "*MozContainer*" style "performance-fix" # Firefox (Not sure if this one does anything though.) - -widget_class "*XfceHeading*" style "xfce-header" -widget_class "*XfceDesktop*" style "xfdesktop-windowlist" -widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view" -widget "xfwm4-tabwin*" style "xfwm-tabwin" -widget_class "*XfsmLogoutDialog*" style "xfsm-logout" -widget_class "*XfsmLogoutDialog*GtkButton" style "xfsm-logout-button" - - diff --git a/themes/scanner/testdata/Themes/Gtk2/gtk-3.0/settings.ini b/themes/scanner/testdata/Themes/Gtk2/gtk-3.0/settings.ini deleted file mode 100644 index 9aa01e55..00000000 --- a/themes/scanner/testdata/Themes/Gtk2/gtk-3.0/settings.ini +++ /dev/null @@ -1,3 +0,0 @@ -[Settings] -gtk-auto-mnemonics = 1 -gtk-visible-focus = automatic diff --git a/themes/scanner/testdata/Themes/Gtk2/index.theme b/themes/scanner/testdata/Themes/Gtk2/index.theme deleted file mode 100644 index 123b925b..00000000 --- a/themes/scanner/testdata/Themes/Gtk2/index.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 diff --git a/themes/scanner/testdata/Themes/Gtk2/metacity-1/metacity-theme-3.xml b/themes/scanner/testdata/Themes/Gtk2/metacity-1/metacity-theme-3.xml deleted file mode 100644 index 69604411..00000000 --- a/themes/scanner/testdata/Themes/Gtk2/metacity-1/metacity-theme-3.xml +++ /dev/null @@ -1,1586 +0,0 @@ -<?xml version="1.0"?> -<metacity_theme> -<info> - <name>Deepin</name> - <author>Satyajit Sahoo</author> - <copyright>GPL-3.0+</copyright> - <date>11 December 2013</date> - <description>Numix Mutter Theme</description> -</info> - -<!-- ::: CONSTANTS ::: --> -<constant name="C_titlebar" value="gtk:custom(wm_bg,#2d2d2d)" /> -<constant name="C_border_focused" value="gtk:custom(wm_border_focused,#484848)" /> -<constant name="C_border_unfocused" value="gtk:custom(wm_border_unfocused,#393939)" /> -<constant name="C_title_focused" value="gtk:custom(wm_title_focused,#dcdcdc)" /> -<constant name="C_title_unfocused" value="gtk:custom(wm_title_unfocused,#888888)" /> -<constant name="C_icons_focused" value="gtk:custom(wm_icons_focused,#dcdcdc)" /> -<constant name="C_icons_focused_prelight" value="gtk:custom(wm_icons_focused_prelight,gtk:bg[SELECTED])" /> -<constant name="C_icons_focused_pressed" value="gtk:custom(wm_icons_focused_pressed,shade/gtk:bg[SELECTED]/0.8)" /> -<constant name="C_icons_unfocused" value="gtk:custom(wm_icons_unfocused,#888888)" /> -<constant name="C_icons_unfocused_prelight" value="gtk:custom(wm_icons_focused_prelight,gtk:bg[SELECTED])" /> -<constant name="C_icons_unfocused_pressed" value="gtk:custom(wm_icons_focused_pressed,shade/gtk:bg[SELECTED]/0.8)" /> - -<!-- ::: GEOMETRY ::: --> -<frame_geometry name="normal" title_scale="medium" rounded_top_left="1" rounded_top_right="1"> - <distance name="left_width" value="1" /> - <distance name="right_width" value="1" /> - <distance name="bottom_height" value="1" /> - <distance name="left_titlebar_edge" value="4" /> - <distance name="right_titlebar_edge" value="4" /> - <distance name="title_vertical_pad" value="0" /> - <aspect_ratio name="button" value="1.0" /> - <border name="title_border" left="8" right="8" top="4" bottom="4" /> - <border name="button_border" left="0" right="0" top="0" bottom="0" /> -</frame_geometry> - -<frame_geometry name="normal_unfocused" title_scale="medium" rounded_top_left="1" rounded_top_right="1" parent="normal" /> - -<frame_geometry name="max" title_scale="medium" parent="normal" rounded_top_left="false" rounded_top_right="false"> - <distance name="left_width" value="0" /> - <distance name="right_width" value="0" /> - <distance name="bottom_height" value="0" /> -</frame_geometry> - -<frame_geometry name="tiled_left" title_scale="medium" rounded_top_left="false" rounded_top_right="false" parent="max"> - <distance name="right_width" value="1" /> -</frame_geometry> - -<frame_geometry name="tiled_right" title_scale="medium" rounded_top_left="false" rounded_top_right="false" parent="max"> - <distance name="left_width" value="1" /> -</frame_geometry> - -<frame_geometry name="small" title_scale="small" parent="normal" rounded_top_left="1" rounded_top_right="1"> - <distance name="title_vertical_pad" value="0" /> - <border name="title_border" left="8" right="8" top="4" bottom="4" /> - <border name="button_border" left="0" right="0" top="0" bottom="0" /> -</frame_geometry> - -<frame_geometry name="small_unfocused" parent="small"> - <distance name="left_titlebar_edge" value="1"/> - <distance name="right_titlebar_edge" value="1"/> -</frame_geometry> - -<frame_geometry name="nobuttons" hide_buttons="true" parent="normal" /> - -<frame_geometry name="border" has_title="false" rounded_top_left="false" rounded_top_right="false" parent="normal" > - <distance name="left_width" value="1" /> - <distance name="right_width" value="1" /> - <distance name="bottom_height" value="1" /> - <distance name="title_vertical_pad" value="0" /> - <border name="title_border" left="0" right="0" top="0" bottom="0" /> - <border name="button_border" left="0" right="0" top="0" bottom="0"/> -</frame_geometry> - -<frame_geometry name="borderless" has_title="false" rounded_top_left="false" rounded_top_right="false" parent="normal"> - <distance name="left_width" value="0" /> - <distance name="right_width" value="0" /> - <distance name="bottom_height" value="0" /> - <distance name="title_vertical_pad" value="0" /> - <border name="title_border" left="0" right="0" top="0" bottom="0" /> - <border name="button_border" left="0" right="0" top="0" bottom="0" /> -</frame_geometry> - -<frame_geometry name="modal" title_scale="small" hide_buttons="true" rounded_top_left="1" rounded_top_right="1" rounded_bottom_right="1" rounded_bottom_left="1" parent="small"> -</frame_geometry> - -<frame_geometry name="attached" title_scale="small" hide_buttons="true" rounded_top_left="1" rounded_top_right="1" parent="small"> -</frame_geometry> - -<!-- ::: TITLES ::: --> -<draw_ops name="title_focused"> - <title version="< 3.1" - x="(0 `max` ((width - title_width) / 2)) + 2" - y="(0 `max` ((height - title_height) / 2))" - color="C_title_focused" /> - <title version=">= 3.1" - x="(0 `max` ((frame_x_center - title_width/2) `min` (width - title_width))) + 2" - y="(0 `max` ((height - title_height) / 2))" - ellipsize_width="width" - color="C_title_focused" /> -</draw_ops> - -<draw_ops name="title_unfocused"> - <title version="< 3.1" - x="(0 `max` ((width - title_width) / 2)) + 2" - y="(0 `max` ((height - title_height) / 2))" - color="C_title_unfocused" /> - <title version=">= 3.1" - x="(0 `max` ((frame_x_center - title_width/2) `min` (width - title_width))) + 2" - y="(0 `max` ((height - title_height) / 2))" - ellipsize_width="width" - color="C_title_unfocused" /> -</draw_ops> - -<!-- ::: WINDOW DECORATIONS ::: --> -<draw_ops name="entire_background_focused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="entire_background_unfocused"> - <include name="entire_background_focused" /> -</draw_ops> - -<draw_ops name="titlebar_fill_focused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="titlebar_fill_attached_focused"> - <include name="entire_background_focused" /> -</draw_ops> - -<draw_ops name="titlebar_fill_unfocused"> - <rectangle color="C_titlebar" x="0" y="0" width="width" height="height" filled="true" /> -</draw_ops> - -<draw_ops name="titlebar_focused"> - <include name="titlebar_fill_focused" /> -</draw_ops> - -<draw_ops name="titlebar_attached_focused"> <!-- titlebar for attached and modal dialogs --> - <include name="titlebar_fill_attached_focused" /> -</draw_ops> - -<draw_ops name="rounded_titlebar_focused"> - <include name="titlebar_fill_focused" /> -</draw_ops> - -<draw_ops name="border_focused"> - <rectangle color="C_border_focused" x="0" y="0" width="width-1" height="height-1" filled="false" /> -</draw_ops> - -<draw_ops name="border_unfocused"> - <rectangle color="C_border_unfocused" x="0" y="0" width="width-1" height="height-1" filled="false" /> -</draw_ops> - -<draw_ops name="rounded_border_focused"> - <line color="C_border_focused" x1="2" y1="0" x2="width-3" y2="0" /> - <line color="C_border_focused" x1="0" y1="height-1" x2="width-1" y2="height-1" /> - <line color="C_border_focused" x1="0" y1="2" x2="0" y2="height-2" /> - <line color="C_border_focused" x1="width-1" y1="2" x2="width-1" y2="height-2" /> - <arc color="C_border_focused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_focused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> - <!-- double arcs for darker borders --> - <arc color="C_border_focused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_focused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> -</draw_ops> - -<draw_ops name="rounded_border_unfocused"> - <line color="C_border_unfocused" x1="2" y1="0" x2="width-3" y2="0" /> - <line color="C_border_unfocused" x1="0" y1="height-1" x2="width-1" y2="height-1" /> - <line color="C_border_unfocused" x1="0" y1="2" x2="0" y2="height-2" /> - <line color="C_border_unfocused" x1="width-1" y1="2" x2="width-1" y2="height-2" /> - <arc color="C_border_unfocused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_unfocused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> - <!-- double arcs for darker borders --> - <arc color="C_border_unfocused" x="0" y="0" width="3" height="3" start_angle="270" extent_angle="90" /> - <arc color="C_border_unfocused" x="width-3" y="0" width="2" height="3" start_angle="0" extent_angle="90" /> -</draw_ops> - -<draw_ops name="border_right_focused"> - <line - x1="width-1" y1="0" - x2="width-1" y2="height" - color="C_border_focused" /> -</draw_ops> - -<draw_ops name="border_right_unfocused"> - <line - x1="width-1" y1="0" - x2="width-1" y2="height" - color="C_border_unfocused" /> -</draw_ops> - -<draw_ops name="border_left_focused"> - <line - x1="0" y1="0" - x2="0" y2="height" - color="C_border_focused" /> -</draw_ops> - -<draw_ops name="border_left_unfocused"> - <line - x1="0" y1="0" - x2="0" y2="height" - color="C_border_unfocused" /> -</draw_ops> - -<!-- ::: BUTTON ICONS ::: --> -<!-- note: negative values in x or y causes gnome-shell to crash --> -<!-- close icon --> -<draw_ops name="close_focused"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="close_focused_prelight"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="close_focused_pressed"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="close_unfocused"> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-2" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+2" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+1" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+2" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-2" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="close_unfocused_prelight"> - <include name="close_focused_prelight" /> -</draw_ops> - -<draw_ops name="close_unfocused_pressed"> - <include name="close_focused_pressed" /> -</draw_ops> - -<!-- maximize icon --> -<draw_ops name="maximize_focused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="maximize_focused_prelight"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="maximize_focused_pressed"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="maximize_unfocused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="maximize_unfocused_prelight"> - <include name="maximize_focused_prelight" /> -</draw_ops> - -<draw_ops name="maximize_unfocused_pressed"> - <include name="maximize_focused_pressed" /> -</draw_ops> - -<!-- unmaximize icon --> -<draw_ops name="unmaximize_focused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="unmaximize_focused_prelight"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="unmaximize_focused_pressed"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused"> - <rectangle - x="(width-width%3)/3+1" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused_prelight"> - <include name="unmaximize_focused_prelight" /> -</draw_ops> - -<draw_ops name="unmaximize_unfocused_pressed"> - <include name="unmaximize_focused_pressed" /> -</draw_ops> - -<!-- minimize icon --> -<draw_ops name="minimize_focused"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="minimize_focused_prelight"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="minimize_focused_pressed"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="minimize_unfocused"> - <rectangle - x="(width-width%3)/3+2" y="height-(height-height%3)/3-5" - width="width-2*(width-width%3)/3-2" height="2" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="minimize_unfocused_prelight"> - <include name="minimize_focused_prelight" /> -</draw_ops> - -<draw_ops name="minimize_unfocused_pressed"> - <include name="minimize_focused_pressed" /> -</draw_ops> - -<!-- menu icon --> -<draw_ops name="menu_focused"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="menu_focused_prelight"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="menu_focused_pressed"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="menu_unfocused"> - <rectangle - x="(width-width%3)/3+2" y="(height-height%3)/3+1" - width="width-2*(width-width%3)/3-3" height="height-2*(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="(height-height%3)/3+2" - width="width-2*(width-width%3)/3-5" height="height-2*(height-height%3)/3-5" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+5" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="2" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="menu_unfocused_prelight"> - <include name="menu_focused_prelight" /> -</draw_ops> - -<draw_ops name="menu_unfocused_pressed"> - <include name="menu_focused_pressed" /> -</draw_ops> - -<!-- shade icon --> -<draw_ops name="shade_focused"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="shade_focused_prelight"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="shade_focused_pressed"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="shade_unfocused"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="shade_unfocused_prelight"> - <include name="shade_focused_prelight" /> -</draw_ops> - -<draw_ops name="shade_unfocused_pressed"> - <include name="shade_focused_pressed" /> -</draw_ops> - -<!-- unshade icon --> -<draw_ops name="unshade_focused"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_focused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_focused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused" /> -</draw_ops> - -<draw_ops name="unshade_focused_prelight"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_focused_prelight" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_focused_prelight" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_prelight" /> -</draw_ops> - -<draw_ops name="unshade_focused_pressed"> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-6" y1="(height-height%3)/3+2" - x2="(width-width%3)/3+1" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="width-(width-width%3)/3-7" y1="(height-height%3)/3+1" - x2="(width-width%3)/3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+3" y1="(height-height%3)/3+2" - x2="width-(width-width%3)/3-4" y2="height-(height-height%3)/3-5" - color="C_icons_focused_pressed" /> - <line - x1="(width-width%3)/3+4" y1="(height-height%3)/3+1" - x2="width-(width-width%3)/3-3" y2="height-(height-height%3)/3-6" - color="C_icons_focused_pressed" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-2" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_focused_pressed" /> -</draw_ops> - -<draw_ops name="unshade_unfocused"> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-3" y1="(height-height%3)/3+5" - x2="(width-width%3)/3+4" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="width-(width-width%3)/3-4" y1="(height-height%3)/3+4" - x2="(width-width%3)/3+3" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3" y1="(height-height%3)/3+5" - x2="width-(width-width%3)/3-7" y2="height-(height-height%3)/3-2" - color="C_icons_unfocused" /> - <line - x1="(width-width%3)/3+1" y1="(height-height%3)/3+4" - x2="width-(width-width%3)/3-6" y2="height-(height-height%3)/3-3" - color="C_icons_unfocused" /> - <rectangle - x="(width-width%3)/3+3" y="height/2-4" - width="width-2*(width-width%3)/3-8" height="6" filled="true" - color="C_icons_unfocused" /> -</draw_ops> - -<draw_ops name="unshade_unfocused_prelight"> - <include name="unshade_focused_prelight" /> -</draw_ops> - -<draw_ops name="unshade_unfocused_pressed"> - <include name="unshade_focused_pressed" /> -</draw_ops> - -<!-- ::: FRAME STYLES ::: --> -<frame_style name="normal_focused" geometry="normal"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="rounded_titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="rounded_border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_unfocused" geometry="normal_unfocused"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="rounded_border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_focused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_unfocused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_shaded_focused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay"><draw_ops><line x1="0" y1="height-1" x2="width" y2="height-1" color="C_border_focused" /></draw_ops></piece> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="normal_max_shaded_unfocused" geometry="max"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay"><draw_ops><line x1="0" y1="height-1" x2="width" y2="height-1" color="C_border_unfocused" /></draw_ops></piece> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="dialog_focused" geometry="nobuttons"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="rounded_titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="rounded_border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="dialog_unfocused" geometry="nobuttons"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="rounded_border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="modal_dialog_focused" geometry="modal"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button><button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="modal_dialog_unfocused" geometry="modal"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="utility_focused" geometry="small"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="utility_unfocused" geometry="small_unfocused"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="border_focused" geometry="border"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="border_unfocused" geometry="border"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="borderless" geometry="borderless"> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="attached_focused" geometry="attached"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_focused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="attached_unfocused" geometry="attached"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_attached_focused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_unfocused" /> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_left_focused" geometry="tiled_left"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_right_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_left_unfocused" geometry="tiled_left"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_right_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_right_focused" geometry="tiled_right"> - <piece position="entire_background" draw_ops="entire_background_focused" /> - <piece position="titlebar" draw_ops="titlebar_fill_focused" /> - <piece position="title" draw_ops="title_focused" /> - <piece position="overlay" draw_ops="border_left_focused" /> - <button function="close" state="normal" draw_ops="close_focused" /> - <button function="close" state="prelight" draw_ops="close_focused_prelight" /> - <button function="close" state="pressed" draw_ops="close_focused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_focused" /> - <button function="maximize" state="prelight" draw_ops="maximize_focused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_focused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_focused" /> - <button function="minimize" state="prelight" draw_ops="minimize_focused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_focused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_focused" /> - <button function="menu" state="prelight" draw_ops="menu_focused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_focused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_focused" /> - <button function="shade" state="prelight" draw_ops="shade_focused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_focused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_focused" /> - <button function="unshade" state="prelight" draw_ops="unshade_focused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_focused_pressed" /> - - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<frame_style name="tiled_right_unfocused" geometry="tiled_right"> - <piece position="entire_background" draw_ops="entire_background_unfocused" /> - <piece position="titlebar" draw_ops="titlebar_fill_unfocused" /> - <piece position="title" draw_ops="title_unfocused" /> - <piece position="overlay" draw_ops="border_left_unfocused" /> - <button function="close" state="normal" draw_ops="close_unfocused" /> - <button function="close" state="prelight" draw_ops="close_unfocused_prelight" /> - <button function="close" state="pressed" draw_ops="close_unfocused_pressed" /> - <button function="maximize" state="normal" draw_ops="maximize_unfocused" /> - <button function="maximize" state="prelight" draw_ops="maximize_unfocused_prelight" /> - <button function="maximize" state="pressed" draw_ops="maximize_unfocused_pressed" /> - <button function="minimize" state="normal" draw_ops="minimize_unfocused" /> - <button function="minimize" state="prelight" draw_ops="minimize_unfocused_prelight" /> - <button function="minimize" state="pressed" draw_ops="minimize_unfocused_pressed" /> - <button function="menu" state="normal" draw_ops="menu_unfocused" /> - <button function="menu" state="prelight" draw_ops="menu_unfocused_prelight" /> - <button function="menu" state="pressed" draw_ops="menu_unfocused_pressed" /> - <button function="shade" state="normal" draw_ops="shade_unfocused" /> - <button function="shade" state="prelight" draw_ops="shade_unfocused_prelight" /> - <button function="shade" state="pressed" draw_ops="shade_unfocused_pressed" /> - <button function="unshade" state="normal" draw_ops="unshade_unfocused" /> - <button function="unshade" state="prelight" draw_ops="unshade_unfocused_prelight" /> - <button function="unshade" state="pressed" draw_ops="unshade_unfocused_pressed" /> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<!-- placeholder for unimplementated styles--> -<frame_style name="blank" geometry="normal"> - <button function="close" state="normal"><draw_ops></draw_ops></button> - <button function="close" state="pressed"><draw_ops></draw_ops></button> - <button function="maximize" state="normal"><draw_ops></draw_ops></button> - <button function="maximize" state="pressed"><draw_ops></draw_ops></button> - <button function="minimize" state="normal"><draw_ops></draw_ops></button> - <button function="minimize" state="pressed"><draw_ops></draw_ops></button> - <button function="menu" state="normal"><draw_ops></draw_ops></button> - <button function="menu" state="pressed"><draw_ops></draw_ops></button> - <button function="shade" state="normal"><draw_ops></draw_ops></button> - <button function="shade" state="prelight"><draw_ops></draw_ops></button> - <button function="shade" state="pressed"><draw_ops></draw_ops></button> - <button function="unshade" state="normal"><draw_ops></draw_ops></button> - <button function="unshade" state="prelight"><draw_ops></draw_ops></button> - <button function="unshade" state="pressed"><draw_ops></draw_ops></button> - <button function="above" state="normal"><draw_ops></draw_ops></button> - <button function="above" state="pressed"><draw_ops></draw_ops></button> - <button function="unabove" state="normal"><draw_ops></draw_ops></button> - <button function="unabove" state="pressed"><draw_ops></draw_ops></button> - <button function="stick" state="normal"><draw_ops></draw_ops></button> - <button function="stick" state="pressed"><draw_ops></draw_ops></button> - <button function="unstick" state="normal"><draw_ops></draw_ops></button> - <button function="unstick" state="pressed"><draw_ops></draw_ops></button> -</frame_style> - -<!-- ::: FRAME STYLE SETS ::: --> -<frame_style_set name="normal_style_set"> - <frame focus="yes" state="normal" resize="both" style="normal_focused" /> - <frame focus="no" state="normal" resize="both" style="normal_unfocused" /> - <frame focus="yes" state="maximized" style="normal_max_focused" /> - <frame focus="no" state="maximized" style="normal_max_unfocused" /> - <frame focus="yes" state="shaded" style="normal_focused" /> - <frame focus="no" state="shaded" style="normal_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="normal_max_shaded_focused" /> - <frame focus="no" state="maximized_and_shaded" style="normal_max_shaded_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_left" style="tiled_left_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_left" style="tiled_left_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_right" style="tiled_right_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_right" style="tiled_right_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_left_and_shaded" style="tiled_left_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_left_and_shaded" style="tiled_left_unfocused" /> - <frame version=">= 3.3" focus="yes" state="tiled_right_and_shaded" style="tiled_right_focused" /> - <frame version=">= 3.3" focus="no" state="tiled_right_and_shaded" style="tiled_right_unfocused" /> -</frame_style_set> - -<frame_style_set name="dialog_style_set"> - <frame focus="yes" state="normal" resize="both" style="dialog_focused" /> - <frame focus="no" state="normal" resize="both" style="dialog_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="dialog_focused" /> - <frame focus="no" state="shaded" style="dialog_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="modal_dialog_style_set"> - <frame focus="yes" state="normal" resize="both" style="modal_dialog_focused" /> - <frame focus="no" state="normal" resize="both" style="modal_dialog_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="modal_dialog_focused" /> - <frame focus="no" state="shaded" style="modal_dialog_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="utility_style_set"> - <frame focus="yes" state="normal" resize="both" style="utility_focused" /> - <frame focus="no" state="normal" resize="both" style="utility_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="utility_focused" /> - <frame focus="no" state="shaded" style="utility_unfocused" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="border_style_set"> - <frame focus="yes" state="normal" resize="both" style="border_focused" /> - <frame focus="no" state="normal" resize="both" style="border_unfocused" /> - <frame focus="yes" state="maximized" style="borderless" /> - <frame focus="no" state="maximized" style="borderless" /> - <frame focus="yes" state="shaded" style="blank" /> - <frame focus="no" state="shaded" style="blank" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<frame_style_set name="attached_style_set"> - <frame focus="yes" state="normal" resize="both" style="attached_focused" /> - <frame focus="no" state="normal" resize="both" style="attached_unfocused" /> - <frame focus="yes" state="maximized" style="blank" /> - <frame focus="no" state="maximized" style="blank" /> - <frame focus="yes" state="shaded" style="blank" /> - <frame focus="no" state="shaded" style="blank" /> - <frame focus="yes" state="maximized_and_shaded" style="blank" /> - <frame focus="no" state="maximized_and_shaded" style="blank" /> -</frame_style_set> - -<!-- ::: WINDOWS ::: --> -<window type="normal" style_set="normal_style_set" /> -<window type="dialog" style_set="dialog_style_set" /> -<window type="modal_dialog" style_set="modal_dialog_style_set" /> -<window type="menu" style_set="utility_style_set" /> -<window type="utility" style_set="utility_style_set" /> -<window type="border" style_set="border_style_set" /> -<window version=">= 3.2" type="attached" style_set="attached_style_set" /> - -</metacity_theme> diff --git a/themes/scanner/testdata/gtk_paper.theme b/themes/scanner/testdata/gtk_paper.theme deleted file mode 100644 index 8a47cf69..00000000 --- a/themes/scanner/testdata/gtk_paper.theme +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=X-GNOME-Metatheme -Name=Paper -Comment=The one and only. -Encoding=UTF-8 - -[X-GNOME-Metatheme] -GtkTheme=Paper -MetacityTheme=Paper -IconTheme=Paper diff --git a/themes/scanner/testdata/gtk_paper_hidden.theme b/themes/scanner/testdata/gtk_paper_hidden.theme deleted file mode 100644 index ece18894..00000000 --- a/themes/scanner/testdata/gtk_paper_hidden.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Type=X-GNOME-Metatheme -Name=Paper -Comment=The one and only. -Encoding=UTF-8 -Hidden=true - -[X-GNOME-Metatheme] -GtkTheme=Paper -MetacityTheme=Paper -IconTheme=Paper diff --git a/themes/scanner/testdata/icon_deepin.theme b/themes/scanner/testdata/icon_deepin.theme deleted file mode 100644 index 123b925b..00000000 --- a/themes/scanner/testdata/icon_deepin.theme +++ /dev/null @@ -1,3 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 diff --git a/themes/scanner/testdata/icon_deepin_hidden.theme b/themes/scanner/testdata/icon_deepin_hidden.theme deleted file mode 100644 index 7a55b3c2..00000000 --- a/themes/scanner/testdata/icon_deepin_hidden.theme +++ /dev/null @@ -1,4 +0,0 @@ -[Icon Theme] -Name=Deepin -Directories=apps/24,apps/32,apps/48 -Hidden=true diff --git a/themes/settings.go b/themes/settings.go deleted file mode 100644 index 124bed7b..00000000 --- a/themes/settings.go +++ /dev/null @@ -1,236 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Theme settings. -package themes - -import ( - "fmt" - "os" - "path" - - "github.com/godbus/dbus/v5" - "github.com/linuxdeepin/dde-api/themes/scanner" - wm "github.com/linuxdeepin/go-dbus-factory/session/com.deepin.wm" - glib "github.com/linuxdeepin/go-gir/glib-2.0" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - wmSchema = "com.deepin.wrap.gnome.desktop.wm.preferences" - metacitySchema = "com.deepin.wrap.gnome.metacity" - interfaceSchema = "com.deepin.wrap.gnome.desktop.interface" - xsettingsSchema = "com.deepin.xsettings" - - xsKeyTheme = "theme-name" - xsKeyIconTheme = "icon-theme-name" - xsKeyCursorName = "gtk-cursor-theme-name" -) - -func SetGtkTheme(name string) error { - if !scanner.IsGtkTheme(getThemePath(name, scanner.ThemeTypeGtk, "themes")) { - return fmt.Errorf("Invalid theme '%s'", name) - } - - err := setGtk2Theme(name) - if err != nil { - return fmt.Errorf("set GTK2 Theme to '%s' failed", name) - } - - err = setGtk3Theme(name) - if err != nil { - return fmt.Errorf("set GTK2 Theme to '%s' failed", name) - } - - old := getXSettingsValue(xsKeyTheme) - if old == name { - return nil - } - - if !setXSettingsKey(xsKeyTheme, name) { - return fmt.Errorf("set theme to '%s' by xsettings failed", - name) - } - - if !setWMTheme(name) { - setXSettingsKey(xsKeyTheme, old) - return fmt.Errorf("set wm theme to '%s' failed", name) - } - - if !setQTTheme(name) { - setXSettingsKey(xsKeyTheme, old) - setWMTheme(old) - return fmt.Errorf("set qt theme to '%s' failed", name) - } - return nil -} - -func SetIconTheme(name string) error { - if !scanner.IsIconTheme(getThemePath(name, scanner.ThemeTypeIcon, "icons")) { - return fmt.Errorf("Invalid theme '%s'", name) - } - - err := setGtk2Icon(name) - if err != nil { - return fmt.Errorf("set GTK2 Icon to '%s' failed", name) - } - - err = setGtk3Icon(name) - if err != nil { - return fmt.Errorf("set GTK3 Icon to '%s' failed", name) - } - - old := getXSettingsValue(xsKeyIconTheme) - if old == name { - return nil - } - - if !setXSettingsKey(xsKeyIconTheme, name) { - return fmt.Errorf("set theme to '%s' by xsettings failed", - name) - } - return nil -} - -func SetCursorTheme(name string) error { - if !scanner.IsCursorTheme(getThemePath(name, scanner.ThemeTypeCursor, "icons")) { - return fmt.Errorf("invalid theme '%s'", name) - } - - err := setGtk2Cursor(name) - if err != nil { - _, _ = fmt.Fprintln(os.Stderr, err) - } - err = setGtk3Cursor(name) - if err != nil { - _, _ = fmt.Fprintln(os.Stderr, err) - } - setDefaultCursor(name) - - old := getXSettingsValue(xsKeyCursorName) - if old == name { - return nil - } - - if !setXSettingsKey(xsKeyCursorName, name) { - return fmt.Errorf("set theme to '%s' by xsettings failed", - name) - } - - setQtCursor(name) - setGtkCursor(name) - setWMCursor(name) - return nil -} - -// set cursor theme for deepin-wm -func setWMCursor(name string) { - ifc, _ := dutils.CheckAndNewGSettings(interfaceSchema) - if ifc != nil { - defer ifc.Unref() - ifc.SetString("cursor-theme", name) - } - - sessionBus, err := dbus.SessionBus() - if err != nil { - _, _ = fmt.Fprintln(os.Stderr, "failed to get session bus:", err) - return - } - - wmObj := wm.NewWm(sessionBus) - err = wmObj.CursorTheme().Set(0, name) - if err != nil { - _, _ = fmt.Fprintln(os.Stderr, "failed to set wm cursorTheme:", err) - } -} - -func GetCursorTheme() string { - return getXSettingsValue(xsKeyCursorName) -} - -func getXSettingsValue(key string) string { - xs, err := dutils.CheckAndNewGSettings(xsettingsSchema) - if err != nil { - return "" - } - defer xs.Unref() - return xs.GetString(key) -} - -func setXSettingsKey(key, value string) bool { - xs, err := dutils.CheckAndNewGSettings(xsettingsSchema) - if err != nil { - return false - } - defer xs.Unref() - return xs.SetString(key, value) -} - -func setWMTheme(name string) bool { - meta, _ := dutils.CheckAndNewGSettings(metacitySchema) - if meta != nil { - defer meta.Unref() - meta.SetString("theme", name) - } - - wm, err := dutils.CheckAndNewGSettings(wmSchema) - if err != nil { - return false - } - defer wm.Unref() - return wm.SetString("theme", name) -} - -func setQTTheme(name string) bool { - config := path.Join(glib.GetUserConfigDir(), "Trolltech.conf") - return setQt4Theme(config) -} - -func setQt4Theme(config string) bool { - value, _ := dutils.ReadKeyFromKeyFile(config, "Qt", "style", "") - if value == "GTK+" { - return true - } - return dutils.WriteKeyToKeyFile(config, "Qt", "style", "GTK+") -} - -func setDefaultCursor(name string) bool { - file := path.Join(os.Getenv("HOME"), ".icons", "default", "index.theme") - err := os.MkdirAll(path.Dir(file), 0755) - if err != nil { - return false - } - - value, _ := dutils.ReadKeyFromKeyFile(file, "Icon Theme", "Inherits", "") - if value == name { - return true - } - return dutils.WriteKeyToKeyFile(file, "Icon Theme", "Inherits", name) -} - -func getThemePath(name, ty, key string) string { - var dirs = []string{ - path.Join(os.Getenv("HOME"), ".local/share/", key), - path.Join(os.Getenv("HOME"), "."+key), - path.Join("/usr/local/share", key), - path.Join("/usr/share", key), - } - - for _, dir := range dirs { - tmp := path.Join(dir, name) - if !dutils.IsFileExist(tmp) { - continue - } - - switch ty { - case scanner.ThemeTypeGtk, scanner.ThemeTypeIcon: - return dutils.EncodeURI(path.Join(tmp, "index.theme"), - dutils.SCHEME_FILE) - case scanner.ThemeTypeCursor: - return dutils.EncodeURI(path.Join(tmp, "cursor.theme"), - dutils.SCHEME_FILE) - } - } - return "" -} diff --git a/themes/testdata/gtkrc-2.0 b/themes/testdata/gtkrc-2.0 deleted file mode 100644 index e1258fd5..00000000 --- a/themes/testdata/gtkrc-2.0 +++ /dev/null @@ -1,16 +0,0 @@ -gtk-theme-name="Paper" -gtk-icon-theme-name="Faenza" -gtk-font-name="sans-serif 9" -gtk-cursor-theme-name="Adwaita" -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle="hintfull" -gtk-xft-rgba="rgb" -gtk-modules="gail:atk-bridge" diff --git a/themes/testdata/settings.ini b/themes/testdata/settings.ini deleted file mode 100644 index fceb59d4..00000000 --- a/themes/testdata/settings.ini +++ /dev/null @@ -1,19 +0,0 @@ -[Settings] -gtk-font-name=sans-serif 9 -gtk-theme-name=Paper -gtk-icon-theme-name=Faenza -gtk-fallback-icon-theme=gnome -gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-menu-images=1 -gtk-button-images=1 -gtk-cursor-theme-name=Adwaita -gtk-cursor-theme-size=0 -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintfull -gtk-xft-rgba=rgb -gtk-modules=gail:atk-bridge -test-list=1;2;3; diff --git a/themes/theme.go b/themes/theme.go deleted file mode 100644 index 7506e86a..00000000 --- a/themes/theme.go +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Gtk/Icon/Cursor theme scanner. -package themes - -import ( - "os" - "path" - - "github.com/linuxdeepin/dde-api/themes/scanner" -) - -// Check whether 'theme' in 'list' -func IsThemeInList(theme string, list []string) bool { - name := path.Base(theme) - for _, l := range list { - if path.Base(l) == name { - return true - } - } - return false -} - -// List gtk theme in system. -// -// Scan '/usr/share/themes' and '$HOME/.themes' -func ListGtkTheme() []string { - return doListTheme( - []string{ - path.Join(os.Getenv("HOME"), ".local/share/themes"), - path.Join(os.Getenv("HOME"), ".themes"), - }, - []string{"/usr/share/themes"}, - scanner.ListGtkTheme) -} - -// List icon theme in system. -// -// Scan '/usr/share/icons' and '$HOME/.icons' -func ListIconTheme() []string { - return doListTheme( - []string{ - path.Join(os.Getenv("HOME"), ".local/share/icons"), - path.Join(os.Getenv("HOME"), ".icons"), - }, - []string{"/usr/share/icons"}, - scanner.ListIconTheme) -} - -// List cursor theme in system. -// -// Scan '/usr/share/icons' and '$HOME/.icons' -func ListCursorTheme() []string { - return doListTheme( - []string{ - path.Join(os.Getenv("HOME"), ".local/share/icons"), - path.Join(os.Getenv("HOME"), ".icons"), - }, - []string{"/usr/share/icons"}, - scanner.ListCursorTheme) -} - -func doListTheme(local, sys []string, scanner func(string) ([]string, error)) []string { - list := scanThemeDirs(local, scanner) - sysList := scanThemeDirs(sys, scanner) - return mergeThemeList(list, sysList) -} - -func scanThemeDirs(dirs []string, scanner func(string) ([]string, error)) []string { - var list []string - for _, d := range dirs { - tmp, err := scanner(d) - if err != nil { - continue - } - list = append(list, tmp...) - } - return list -} - -func mergeThemeList(src, target []string) []string { - if len(target) == 0 { - return src - } - - for _, t := range target { - if IsThemeInList(t, src) { - continue - } - src = append(src, t) - } - return src -} diff --git a/themes/theme_test.go b/themes/theme_test.go deleted file mode 100644 index ebcfa96d..00000000 --- a/themes/theme_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package themes - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestMergeThemeList(t *testing.T) { - src := []string{"Deepin", "Adwaita", "Zukitwo"} - target := []string{"Deepin", "Evolve"} - ret := []string{"Deepin", "Adwaita", "Zukitwo", "Evolve"} - - assert.ElementsMatch(t, mergeThemeList(src, target), ret) -} - -func TestSetQt4Theme(t *testing.T) { - config := "/tmp/Trolltech.conf" - assert.Equal(t, setQt4Theme(config), true) - os.Remove(config) -} diff --git a/thumbnailer/main.go b/thumbnailer/main.go deleted file mode 100644 index d8fa6ca2..00000000 --- a/thumbnailer/main.go +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package main - -import ( - "fmt" - - "github.com/linuxdeepin/dde-api/thumbnails" - kingpin "gopkg.in/alecthomas/kingpin.v2" -) - -const ( - SizeTypeNormal int = 128 - SizeTypeLarge int = 256 -) - -func main() { - var ( - src = kingpin.Flag("src", "Source file").String() - size = kingpin.Flag("size", "Thumbnail size").Int() - ) - kingpin.Parse() - - if len(*src) == 0 { - fmt.Println("Please input source file") - return - } - - if *size < 0 { - fmt.Println("Invalid size:", *size) - return - } - - if *size == 0 { - dest, err := thumbnails.GenThumbnail(*src, SizeTypeNormal) - if err != nil { - fmt.Printf("Gen '%s' thumbnail in size '%v' failed: %v\n", *src, SizeTypeNormal, err) - return - } - fmt.Printf("Thumbnail[%v]: %v\n", SizeTypeNormal, dest) - - dest, err = thumbnails.GenThumbnail(*src, SizeTypeLarge) - if err != nil { - fmt.Printf("Gen '%s' thumbnail in size '%v' failed: %v\n", *src, SizeTypeLarge, err) - return - } - fmt.Printf("Thumbnail[%v]: %v\n", SizeTypeLarge, dest) - return - } - - dest, err := thumbnails.GenThumbnail(*src, *size) - if err != nil { - fmt.Printf("Gen '%s' thumbnail in size '%v' failed: %v\n", *src, *size, err) - return - } - fmt.Printf("Thumbnail[%v]: %v\n", *size, dest) -} diff --git a/thumbnails/cursor/cursor.go b/thumbnails/cursor/cursor.go deleted file mode 100644 index 84a2d9ff..00000000 --- a/thumbnails/cursor/cursor.go +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -//Cursor theme thumbnail generator -package cursor - -import ( - "fmt" - "os" - "path" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - sysThemeThumbDir = "/var/cache/thumbnails/appearance" -) - -var themeThumbDir = path.Join(os.Getenv("HOME"), - ".cache", "thumbnails", "appearance") - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, GenThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - mime.MimeTypeCursor, - } -} - -// GenThumbnail generate cursor theme thumbnail -// src: the uri of cursor theme index.theme -func GenThumbnail(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - - if ty != mime.MimeTypeCursor { - return "", fmt.Errorf("Not supported type: %v", ty) - } - - return genCursorThumbnail(src, bg, width, height, force) -} - -// ThumbnailForTheme generate thumbnail for deepin appearance preview -func ThumbnailForTheme(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - dest, err := getThumbDest(src, width, height, true) - if err != nil { - return "", err - } - - thumb := path.Join(sysThemeThumbDir, path.Base(dest)) - if !force && dutils.IsFileExist(thumb) { - return thumb, nil - } - - return doGenThumbnail(src, bg, dest, width, height, force, true) -} - -func genCursorThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := getThumbDest(src, width, height, false) - if err != nil { - return "", err - } - - return doGenThumbnail(src, bg, dest, width, height, force, false) -} - -func getThumbDest(src string, width, height int, theme bool) (string, error) { - var ( - dest string - err error - ) - if dutils.IsFileExist(src) { - dest, err = GetThumbnailDest(src, width, height) - } else { - dest, err = GetThumbnailDest(path.Join(path.Dir(dutils.DecodeURI(src)), - "cursors", "left_ptr"), width, height) - dest = path.Join(path.Dir(dest), "cursor-"+path.Base(dest)) - } - if err != nil { - return "", err - } - - if theme { - dest = path.Join(themeThumbDir, "cursor-"+path.Base(dest)) - } - return dest, nil -} diff --git a/thumbnails/cursor/thumbnail.go b/thumbnails/cursor/thumbnail.go deleted file mode 100644 index 4a9ab4f1..00000000 --- a/thumbnails/cursor/thumbnail.go +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package cursor - -import ( - "io/ioutil" - "os" - "path" - - "github.com/linuxdeepin/dde-api/thumbnails/loader" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - defaultWidth = 320 - defaultHeight = 70 - defaultIconSize = 24 - defaultPadding = 12 -) - -func doGenThumbnail(src, bg, dest string, width, height int, force, theme bool) (string, error) { - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - src = dutils.DecodeURI(src) - bg = dutils.DecodeURI(bg) - dir := path.Dir(src) - tmp := loader.GetTmpImage() - cacheDir, err := ioutil.TempDir("", "xcur2png") - if err != nil { - return "", err - } - defer os.RemoveAll(cacheDir) - - cursorIcons := getCursorIcons(dir, cacheDir) - err = loader.CompositeIcons(cursorIcons, bg, tmp, - defaultIconSize, defaultWidth, defaultHeight, defaultPadding) - if err != nil { - return "", err - } - - defer os.Remove(tmp) - if !theme { - err = loader.ThumbnailImage(tmp, dest, width, height) - } else { - err = loader.ScaleImage(tmp, dest, width, height) - } - if err != nil { - return "", err - } - - return dest, nil -} - -var presentCursors = [][]string{ - {"left_ptr"}, - {"left_ptr_watch"}, - {"x-cursor", "X_cursor"}, - {"hand2", "hand1"}, - {"grab", "grabbing", "closedhand"}, - {"move"}, - {"sb_v_double_arrow"}, - {"sb_h_double_arrow"}, - {"watch", "wait"}, -} - -func getCursorIcons(dir, cacheDir string) []string { - var files []string - for _, cursors := range presentCursors { - for _, cursor := range cursors { - tmp, err := XCursorToPng(path.Join(dir, "cursors", cursor), cacheDir) - if err == nil { - files = append(files, tmp) - break - } - } - } - return files -} diff --git a/thumbnails/cursor/xcur2png.go b/thumbnails/cursor/xcur2png.go deleted file mode 100644 index a94388a6..00000000 --- a/thumbnails/cursor/xcur2png.go +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package cursor - -/* -#cgo pkg-config: xcursor -#cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -#include <stdlib.h> -#include <X11/Xcursor/Xcursor.h> -*/ -import "C" -import ( - "fmt" - "image" - "image/color" - "image/png" - "os" - "path/filepath" - "unsafe" -) - -func loadXCursorImage(filename string, size int) *C.XcursorImage { - cFilename := C.CString(filename) - xcImg := C.XcursorFilenameLoadImage(cFilename, C.int(size)) - C.free(unsafe.Pointer(cFilename)) - return xcImg -} - -func destroyXCursorImage(img *C.XcursorImage) { - C.XcursorImageDestroy(img) -} - -func newImageFromXCurorImage(img *C.XcursorImage) image.Image { - width := int(img.width) - height := int(img.height) - n := width * height - // NOTE: (1 << 12) > 48*48 - pixels := (*[1 << 12]C.XcursorPixel)(unsafe.Pointer(img.pixels))[:n:n] - newImg := image.NewRGBA(image.Rect(0, 0, int(img.width), int(img.height))) - var i = 0 - for y := 0; y < height; y++ { - for x := 0; x < width; x++ { - pixel := pixels[i] - // pixel format: ARGB - alpha := uint8(pixel >> 24) - red := uint8((pixel >> 16) & 0xff) - green := uint8((pixel >> 8) & 0xff) - blue := uint8(pixel & 0xff) - color := color.RGBA{R: red, G: green, B: blue, A: alpha} - newImg.SetRGBA(x, y, color) - i++ - } - } - return newImg -} - -func savePngFile(m image.Image, filename string) error { - f, err := os.Create(filename) - if err != nil { - return err - } - defer func() { - _ = f.Close() - }() - return png.Encode(f, m) -} - -func XCursorToPng(filename, destDir string) (string, error) { - xcImg := loadXCursorImage(filename, 24) - if xcImg == nil { - return "", fmt.Errorf("load x cursor image %q failed", filename) - } - defer destroyXCursorImage(xcImg) - img := newImageFromXCurorImage(xcImg) - dest := filepath.Join(destDir, filepath.Base(filename)+".png") - err := savePngFile(img, dest) - if err != nil { - return "", err - } - return dest, nil -} diff --git a/thumbnails/font/font.go b/thumbnails/font/font.go deleted file mode 100644 index 78e0e6cd..00000000 --- a/thumbnails/font/font.go +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package font - -import ( - "fmt" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - FontTypeTTF = "application/x-font-ttf" - FontTypeOTF = "application/vnd.ms-opentype" -) - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, genFontThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - FontTypeOTF, - FontTypeTTF, - } -} - -func GenThumbnail(src string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - - if !IsStrInList(ty, SupportedTypes()) { - return "", fmt.Errorf("Not supported type: %v", ty) - } - - return genFontThumbnail(src, "", width, height, force) -} - -func genFontThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := GetThumbnailDest(src, width, height) - if err != nil { - return "", err - } - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - return doGenThumbnail(dutils.DecodeURI(src), dest, width, height) -} diff --git a/thumbnails/font/thumbnail.c b/thumbnails/font/thumbnail.c deleted file mode 100644 index 619cd520..00000000 --- a/thumbnails/font/thumbnail.c +++ /dev/null @@ -1,309 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -/** - * Font file thumbnail generator. - * - * Reference gnome-font-viewer - **/ -#include <ft2build.h> -#include FT_FREETYPE_H - -#include <cairo-ft.h> -#include <glib.h> - -#include <math.h> - - -#define PADDING_VERTICAL 2 -#define PADDING_HORIZONTAL 4 - -#define DEFAULT_THUMB_STR "Aa" - -static cairo_t* create_cairo_with_white_bg(gint size); -static void draw_text(cairo_t* cr, FT_Face face, gchar* text, gint size); -static gsize read_file(gchar* file, gchar** contents); -static gdouble calculate_scale(gint width, gint height, gint size); - -static FT_Face create_font_face(FT_Library library, - gchar* contents, gsize length); -static const gchar* ft_strerror (FT_Error error); -static gboolean check_font_contain_text(FT_Face face, const gchar* text); -static gchar* check_for_ascii_glyph_numbers(FT_Face face, - gboolean* found_ascii); -static void destroy_ft_face(FT_Face face); -static void destroy_ft_library(FT_Library library); -static gchar* build_fallback_thumbstr(FT_Face face); - -int -font_thumbnail(char* file, char* dest, int size) -{ - gchar* contents; - gsize length = read_file(file, &contents); - if (length == 0) { - return -1; - } - - FT_Library library; - FT_Error error = FT_Init_FreeType(&library); - if (error) { - g_free(contents); - g_printerr("Could not init freetype: %s\n", ft_strerror(error)); - return -1; - } - - FT_Face face = create_font_face(library, contents, length); - if (!face) { - g_free(contents); - destroy_ft_library(library); - return -1; - } - - cairo_t* cr = create_cairo_with_white_bg(size); - draw_text(cr, face, DEFAULT_THUMB_STR, size); - cairo_surface_write_to_png(cairo_get_target(cr), dest); - cairo_destroy(cr); - - // Must free at end, otherwise no text on thumbnail image - g_free(contents); - destroy_ft_face(face); - destroy_ft_library(library); - return 0; -} - -static cairo_t* -create_cairo_with_white_bg(gint size) -{ - cairo_surface_t* surface = cairo_image_surface_create( - CAIRO_FORMAT_ARGB32, - size, - size); - cairo_t* cr = cairo_create(surface); - cairo_surface_destroy(surface); - - //background color: white - cairo_set_source_rgb(cr, 1, 1, 1); - cairo_paint(cr); - - return cr; -} - -static void -draw_text(cairo_t* cr, FT_Face face, gchar* text, gint size) -{ - cairo_font_face_t* font = cairo_ft_font_face_create_for_ft_face(face, 0); - cairo_set_font_face(cr, font); - cairo_font_face_destroy(font); - gint font_size = size - 2 * PADDING_VERTICAL; - cairo_set_font_size(cr, font_size); - - gchar* str; - if (check_font_contain_text(face, text)) { - str = g_strdup(text); - }else { - str = build_fallback_thumbstr(face); - } - - cairo_text_extents_t extents; - cairo_text_extents(cr, str, &extents); - gdouble scale = calculate_scale(extents.width, extents.height, size); - cairo_scale(cr, scale, scale); - - cairo_translate(cr, - PADDING_HORIZONTAL - extents.x_bearing + (size - scale * extents.width) / 2.0, - PADDING_VERTICAL - extents.y_bearing + (size - scale * extents.height) / 2.0); - - // black - cairo_set_source_rgba(cr, 0, 0, 0, 1.0); - cairo_show_text(cr, str); - - g_free(str); -} - -static gsize -read_file(gchar* file, gchar** contents) -{ - GError* error = NULL; - gsize length; - - g_file_get_contents(file, contents, &length, &error); - if (error) { - g_printerr("Read '%s' contents failed: %s\n", - file, error->message); - g_error_free(error); - return 0; - } - - return length; -} - -static gdouble -calculate_scale(gint width, gint height, gint size) -{ - gdouble scale_x, scale_y; - - if (width > (size - 2 * PADDING_HORIZONTAL)) { - scale_x = (gdouble)(size - 2 * PADDING_HORIZONTAL) / width; - } else { - scale_x = 1.0; - } - - if (height > (size - 2 * PADDING_VERTICAL)) { - scale_y = (gdouble)(size - 2 * PADDING_VERTICAL) / height; - } else { - scale_y = 1.0; - } - - return MIN(scale_x, scale_y); -} - -static FT_Face -create_font_face(FT_Library library, gchar* contents, gsize length) -{ - FT_Face face; - FT_Error error = FT_New_Memory_Face(library, - (const FT_Byte*)contents, - (FT_Long)length, - 0, &face); - if (error) { - g_printerr("Create font face failed: %s\n", ft_strerror(error)); - return NULL; - } - - return face; -} - -static gboolean -check_font_contain_text(FT_Face face, const gchar* text) -{ - glong len, idx, map; - gboolean retval; - gunichar* str = g_utf8_to_ucs4_fast(text, -1, &len); - - FT_CharMap charmap; - for (map = 0; map < face->num_charmaps; map++) { - charmap = face->charmaps[map]; - FT_Set_Charmap(face, charmap); - - retval = TRUE; - - for (idx = 0; idx < len; idx++) { - gunichar c = str[idx]; - if (!FT_Get_Char_Index(face, c)) { - retval = FALSE; - break; - } - } - - if (retval) { - break; - } - } - - g_free(str); - return retval; -} - -static gchar* -check_for_ascii_glyph_numbers(FT_Face face,gboolean* found_ascii) -{ - *found_ascii = FALSE; - - GString *ascii_str = g_string_new(NULL); - GString *str = g_string_new(NULL); - guint glyph, found = 0; - gulong c = FT_Get_First_Char(face, &glyph); - - do { - if (glyph == 65 || glyph == 97) { - g_string_append_unichar(ascii_str, (gunichar)c); - found++; - } - - if (found == 2) { - break; - } - - g_string_append_unichar(str, (gunichar)c); - c = FT_Get_Next_Char(face, c, &glyph); - } while (glyph != 0); - - if (found == 2) { - *found_ascii = TRUE; - g_string_free(str, TRUE); - return g_string_free(ascii_str, FALSE); - } else { - g_string_free(ascii_str, TRUE); - return g_string_free(str, FALSE); - } - -} - -static gchar* -build_fallback_thumbstr(FT_Face face) -{ - gboolean found_ascii = FALSE; - gchar* chars = check_for_ascii_glyph_numbers(face, &found_ascii); - - if (found_ascii) { - return chars; - } - - gint idx = 0; - GString* retval = g_string_new(NULL); - gint total_chars = g_utf8_strlen(chars, -1); - - gchar *ptr, *end; - while(idx < 2) { - total_chars = (gint)floor(total_chars / 2.0); - ptr = g_utf8_offset_to_pointer(chars, total_chars); - end = g_utf8_find_next_char(ptr, NULL); - - g_string_append_len(retval, ptr, end - ptr); - idx++; - } - - return g_string_free(retval, FALSE); -} - -/** - * FT_ERRORS_H is a special header file which is used to define - * the handling of FT2 enumeration constants, and can also be - * used to generate error message strings with a small macro trick. - * much more details in freetype2/fterrors.h. - **/ -static const gchar * -ft_strerror (FT_Error error) -{ -#undef __FTERRORS_H__ -#define FT_ERRORDEF(e,v,s) case e: return s; -#define FT_ERROR_START_LIST -#define FT_ERROR_END_LIST - switch (error) - { -#include FT_ERRORS_H - default: - return "unknown"; - } -} - -static void -destroy_ft_face(FT_Face face) -{ - FT_Error error = FT_Done_Face(face); - if (error) { - g_printerr("Could not finalize font face: %s\n", - ft_strerror(error)); - } -} - -static void -destroy_ft_library(FT_Library library) -{ - FT_Error error = FT_Done_FreeType(library); - if (error) { - g_printerr("Could not finalize freetype library:%s \n", - ft_strerror(error)); - } -} diff --git a/thumbnails/font/thumbnail.h b/thumbnails/font/thumbnail.h deleted file mode 100644 index 7667fb2e..00000000 --- a/thumbnails/font/thumbnail.h +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __THUMBNAIL_H__ -#define __THUMBNAIL_H__ - -int font_thumbnail(char* file, char* dest, int size); - -#endif diff --git a/thumbnails/font/wrapper.go b/thumbnails/font/wrapper.go deleted file mode 100644 index a9a4ade5..00000000 --- a/thumbnails/font/wrapper.go +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package font - -// #cgo pkg-config: cairo-ft glib-2.0 -// #cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -// #cgo LDFLAGS: -lm -// #include <stdlib.h> -// #include "thumbnail.h" -import "C" - -import ( - "fmt" - "os" - "unsafe" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" -) - -func doGenThumbnail(file, dest string, width, height int) (string, error) { - cFile := C.CString(file) - defer C.free(unsafe.Pointer(cFile)) - tmp := GetTmpImage() - cTmp := C.CString(tmp) - defer C.free(unsafe.Pointer(cTmp)) - ret := C.font_thumbnail(cFile, cTmp, C.int(getThumbSize(width, height))) - if ret == -1 { - return "", fmt.Errorf("Gen thumbnail for '%s' failed", file) - } - - defer os.Remove(tmp) - err := ThumbnailImage(tmp, dest, width, height) - if err != nil { - return "", err - } - - return dest, nil -} - -func getThumbSize(width, height int) int { - if width > height { - return width - } - return height -} diff --git a/thumbnails/gtk/gtk.go b/thumbnails/gtk/gtk.go deleted file mode 100644 index 3f861fa9..00000000 --- a/thumbnails/gtk/gtk.go +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Gtk theme thumbnail generator -package gtk - -import ( - "fmt" - "os" - "os/exec" - "path" - "strconv" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - sysThemeThumbDir = "/var/cache/thumbnails/appearance" - - cmdGtkThumbnailer = "/usr/lib/deepin-api/gtk-thumbnailer" -) - -var themeThumbDir = path.Join(os.Getenv("HOME"), - ".cache", "thumbnails", "appearance") - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, genGtkThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - mime.MimeTypeGtk, - } -} - -func GenThumbnail(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - if ty != mime.MimeTypeGtk { - return "", fmt.Errorf("Unsupported mime: %s", ty) - } - - return genGtkThumbnail(src, bg, width, height, force) -} - -func ThumbnailForTheme(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - dest, err := getThumbDest(src, width, height, true) - if err != nil { - return "", err - } - - thumb := path.Join(sysThemeThumbDir, path.Base(dest)) - if !force && dutils.IsFileExist(thumb) { - return thumb, nil - } - - return doGenThumbnail(path.Base(path.Dir(src)), bg, dest, - width, height, force) -} - -func genGtkThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := getThumbDest(src, width, height, false) - if err != nil { - return "", err - } - - return doGenThumbnail(path.Base(path.Dir(src)), bg, dest, - width, height, force) -} - -func getThumbDest(src string, width, height int, theme bool) (string, error) { - dest, err := GetThumbnailDest(src, width, height) - if err != nil { - return "", err - } - - if theme { - dest = path.Join(themeThumbDir, "gtk-"+path.Base(dest)) - } - return dest, nil -} - -func doGenThumbnail(name, bg, dest string, width, height int, force bool) (string, error) { - var args = []string{ - "-theme", name, - "-dest", dest, - "-width", strconv.Itoa(width), - "-height", strconv.Itoa(height), - } - if force { - args = append(args, "-force") - } - _, err := exec.Command(cmdGtkThumbnailer, args...).CombinedOutput() - if err != nil { - return "", err - } - return dest, nil -} diff --git a/thumbnails/icon/icon.c b/thumbnails/icon/icon.c deleted file mode 100644 index 32e1ca67..00000000 --- a/thumbnails/icon/icon.c +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include <gtk/gtk.h> -#include "icon.h" - -char *choose_icon(char *theme, const char **names, int size) -{ - if (!gtk_init_check(NULL, NULL)) { - g_warning("Init gtk environment failed"); - return NULL; - } - - GtkIconTheme *icon_theme = gtk_icon_theme_new(); - gtk_icon_theme_set_custom_theme(icon_theme, theme); - GtkIconInfo *info = gtk_icon_theme_choose_icon(icon_theme, - names, size, 0); - g_object_unref(G_OBJECT(icon_theme)); - if (!info) { - return NULL; - } - - char *file = g_strdup(gtk_icon_info_get_filename(info)); - g_object_unref(G_OBJECT(info)); - - return file; -} diff --git a/thumbnails/icon/icon.go b/thumbnails/icon/icon.go deleted file mode 100644 index 06890e75..00000000 --- a/thumbnails/icon/icon.go +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -//Icon theme thumbnail generator -package icon - -import ( - "fmt" - "os" - "path" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - sysThemeThumbDir = "/var/cache/thumbnails/appearance" -) - -var themeThumbDir = path.Join(os.Getenv("HOME"), - ".cache", "thumbnails", "appearance") - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, genIconThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - mime.MimeTypeIcon, - } -} - -// GenThumbnail generate icon theme thumbnail -// src: the uri of icon theme index.theme -func GenThumbnail(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - - if ty != mime.MimeTypeIcon { - return "", fmt.Errorf("Not supported type: %v", ty) - } - - return genIconThumbnail(src, bg, width, height, force) -} - -func ThumbnailForTheme(src, bg string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - dest, err := getThumbDest(src, width, height, true) - if err != nil { - return "", err - } - - thumb := path.Join(sysThemeThumbDir, path.Base(dest)) - if !force && dutils.IsFileExist(thumb) { - return thumb, nil - } - - return doGenThumbnail(src, bg, dest, width, height, force, true) -} - -func genIconThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := getThumbDest(src, width, height, false) - if err != nil { - return "", err - } - - return doGenThumbnail(src, bg, dest, width, height, force, false) -} - -func getThumbDest(src string, width, height int, theme bool) (string, error) { - dest, err := GetThumbnailDest(src, width, height) - if err != nil { - return "", err - } - - if theme { - dest = path.Join(themeThumbDir, "icon-"+path.Base(dest)) - } - return dest, nil -} diff --git a/thumbnails/icon/icon.h b/thumbnails/icon/icon.h deleted file mode 100644 index 57e1c2f8..00000000 --- a/thumbnails/icon/icon.h +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __LOOKUP_H__ -#define __LOOKUP_H__ - -char* choose_icon(char* theme, const char** names, int size); - -#endif diff --git a/thumbnails/icon/thumbnail.go b/thumbnails/icon/thumbnail.go deleted file mode 100644 index 244534d1..00000000 --- a/thumbnails/icon/thumbnail.go +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package icon - -import ( - "os" - "path/filepath" - - "github.com/linuxdeepin/dde-api/thumbnails/images" - "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/graphic" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - defaultWidth = 320 - defaultHeight = 70 - defaultIconSize = 48 - defaultPadding = 4 -) - -func doGenThumbnail(src, bg, dest string, width, height int, force, theme bool) (string, error) { - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - src = dutils.DecodeURI(src) - bg = dutils.DecodeURI(bg) - dir := filepath.Dir(src) - tmp := loader.GetTmpImage() - themeName := filepath.Base(dir) - iconFiles := getIconFiles(themeName) - err := loader.CompositeIcons(iconFiles, bg, tmp, - defaultIconSize, defaultWidth, defaultHeight, defaultPadding) - if err != nil { - return "", err - } - defer os.Remove(tmp) - - if !theme { - err = loader.ThumbnailImage(tmp, dest, width, height) - } else { - err = loader.ScaleImage(tmp, dest, width, height) - } - if err != nil { - return "", err - } - - return dest, nil -} - -// default present icons -var presentIcons = [][]string{ - // file manager: - {"dde-file-manager", "system-file-manager"}, - // music player: - {"deepin-music", "banshee", "amarok", "deadbeef", "clementine", "rhythmbox"}, - // image viewer: - {"deepin-image-viewer", "eog", "gthumb", "gwenview", "gpicview", "showfoto", "phototonic"}, - // media/video player: - {"deepin-movie", "media-player", "totem", "smplayer", "vlc", "dragonplayer", "kmplayer"}, - // web browser: - {"google-chrome", "firefox", "chromium", "opear", "internet-web-browser", "web-browser", "browser"}, - // system settings: - {"preferences-system"}, - // text editor: - {"accessories-text-editor", "text-editor", "gedit", "kedit", "xfce-edit"}, - // terminal: - {"deepin-terminal", "utilities-terminal", "terminal", "gnome-terminal", "xfce-terminal", "terminator", "openterm"}, -} - -func getIconFiles(theme string) []string { - var files []string - for _, iconNames := range presentIcons { - file := ChooseIcon(theme, iconNames) - if file != "" { - files = append(files, file) - if len(files) == 6 { - break - } - } - } - - return fixIconFiles(files) -} - -func fixIconFiles(files []string) []string { - var ret []string - for _, file := range files { - ext := filepath.Ext(file) - genThumbnail := false - if ext == ".svg" { - genThumbnail = true - } else { - // check size - w, h, err := graphic.GetImageSize(file) - if err != nil { - continue - } - if !(w == defaultIconSize && w == h) { - genThumbnail = true - } - } - - if genThumbnail { - var err error - file, err = images.GenThumbnail(file, defaultIconSize, defaultIconSize, true) - if err != nil { - continue - } - } - ret = append(ret, file) - } - - return ret -} diff --git a/thumbnails/icon/wrapper.go b/thumbnails/icon/wrapper.go deleted file mode 100644 index 641579d6..00000000 --- a/thumbnails/icon/wrapper.go +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package icon - -// #cgo pkg-config: gtk+-3.0 -// #include <stdlib.h> -// #include "icon.h" -import "C" - -import ( - "unsafe" -) - -func ChooseIcon(theme string, names []string) string { - cTheme := C.CString(theme) - defer C.free(unsafe.Pointer(cTheme)) - - cArr := StrvInC(names) - cNames := (**C.char)(unsafe.Pointer(&cArr[0])) - cFile := C.choose_icon(cTheme, cNames, C.int(defaultIconSize)) - - // free cArr - for i := range cArr { - C.free(unsafe.Pointer(cArr[i])) - } - defer C.free(unsafe.Pointer(cFile)) - - return C.GoString(cFile) -} - -// return NUL-Terminated slice of C String -func StrvInC(strv []string) []*C.char { - cArr := make([]*C.char, len(strv)+1) - for i, str := range strv { - cArr[i] = C.CString(str) - } - return cArr -} diff --git a/thumbnails/images/convert.c b/thumbnails/images/convert.c deleted file mode 100644 index 3908c6a1..00000000 --- a/thumbnails/images/convert.c +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include <gdk/gdk.h> -#include <librsvg/rsvg.h> - -#include "convert.h" - -int -svg_to_png(const char* file, const char* dest) -{ - if (!gdk_init_check(NULL, NULL)) { - g_warning("Init gdk environment failed"); - return -1; - } - - GError* error = NULL; - RsvgHandle* handler = rsvg_handle_new_from_file(file, &error); - if (error) { - g_warning("New RsvgHandle failed: %s", error->message); - g_error_free(error); - return -1; - } - - GdkPixbuf* pbuf = rsvg_handle_get_pixbuf(handler); - g_object_unref(G_OBJECT(handler)); - - error = NULL; - gdk_pixbuf_save(pbuf, dest, "png", &error, NULL); - g_object_unref(G_OBJECT(pbuf)); - if (error) { - g_warning("Save to png file failed: %s", error->message); - g_error_free(error); - return -1; - } - - return 0; -} diff --git a/thumbnails/images/convert.h b/thumbnails/images/convert.h deleted file mode 100644 index fcc2f97c..00000000 --- a/thumbnails/images/convert.h +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __CONVERT_H__ -#define __CONVERT_H__ - -int svg_to_png(const char* file, const char* dest); - -#endif diff --git a/thumbnails/images/images.go b/thumbnails/images/images.go deleted file mode 100644 index f067e65b..00000000 --- a/thumbnails/images/images.go +++ /dev/null @@ -1,143 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Image thumbnail generator -package images - -import ( - "fmt" - "os" - "path" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - sysThemeThumbDir = "/var/cache/thumbnails/appearance" -) - -const ( - ImageTypePng string = "image/png" - ImageTypeJpeg string = "image/jpeg" - ImageTypeGif string = "image/gif" - ImageTypeBmp string = "image/bmp" - ImageTypeTiff string = "image/tiff" - ImageTypeSvg string = "image/svg+xml" -) - -var themeThumbDir = path.Join(os.Getenv("HOME"), - ".cache", "thumbnails", "appearance") - -func init() { - for _, ty := range SupportedTypes() { - switch ty { - case ImageTypeSvg: - Register(ty, genSvgThumbnail) - default: - Register(ty, genImageThumbnail) - } - } -} - -func SupportedTypes() []string { - return []string{ - ImageTypePng, - ImageTypeJpeg, - ImageTypeGif, - ImageTypeBmp, - ImageTypeTiff, - ImageTypeSvg, - } -} - -func GenThumbnail(src string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - - if !IsStrInList(ty, SupportedTypes()) { - return "", fmt.Errorf("No supported type: %v", ty) - } - - switch ty { - case ImageTypeSvg: - return genSvgThumbnail(src, "", width, height, force) - } - - return genImageThumbnail(src, "", width, height, force) -} - -func ThumbnailForTheme(src string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - dest, err := getThumbDest(src, width, height, true) - if err != nil { - return "", err - } - - thumb := path.Join(sysThemeThumbDir, path.Base(dest)) - if !force && dutils.IsFileExist(thumb) { - return thumb, nil - } - - return doGenThumbnail(src, "", dest, width, height, force, true) -} - -func genSvgThumbnail(src, bg string, width, height int, force bool) (string, error) { - tmp := GetTmpImage() - err := svgToPng(src, tmp) - if err != nil { - return "", err - } - - defer os.Remove(tmp) - return genImageThumbnail(tmp, bg, width, height, force) -} - -func genImageThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := getThumbDest(src, width, height, false) - if err != nil { - return "", err - } - - return doGenThumbnail(src, bg, dest, width, height, force, false) -} - -func doGenThumbnail(src, bg, dest string, width, height int, force, theme bool) (string, error) { - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - var err error - src = dutils.DecodeURI(src) - if !theme { - err = ThumbnailImage(src, dest, width, height) - } else { - err = ScaleImage(src, dest, width, height) - } - if err != nil { - return "", err - } - return dest, nil -} - -func getThumbDest(src string, width, height int, theme bool) (string, error) { - dest, err := GetThumbnailDest(src, width, height) - if err != nil { - return "", err - } - if theme { - dest = path.Join(themeThumbDir, "bg-"+path.Base(dest)) - } - return dest, nil -} diff --git a/thumbnails/images/wrapper.go b/thumbnails/images/wrapper.go deleted file mode 100644 index 217fe043..00000000 --- a/thumbnails/images/wrapper.go +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package images - -// #cgo pkg-config: gdk-3.0 librsvg-2.0 -// #cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -// #include <stdlib.h> -// #include "convert.h" -import "C" - -import ( - "fmt" - "unsafe" -) - -func svgToPng(src, dest string) error { - cSrc := C.CString(src) - defer C.free(unsafe.Pointer(cSrc)) - cDest := C.CString(dest) - defer C.free(unsafe.Pointer(cDest)) - - ret := C.svg_to_png(cSrc, cDest) - if ret != 0 { - return fmt.Errorf("Convert svg to png failed") - } - return nil -} diff --git a/thumbnails/loader/loader.go b/thumbnails/loader/loader.go deleted file mode 100644 index 3c0f9f2e..00000000 --- a/thumbnails/loader/loader.go +++ /dev/null @@ -1,215 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Load thumbnail handlers -package loader - -import ( - "fmt" - "math/rand" - "os" - "path" - "github.com/linuxdeepin/go-lib/graphic" - dutils "github.com/linuxdeepin/go-lib/utils" - "github.com/linuxdeepin/go-lib/xdg/basedir" - "sync" - "time" -) - -const ( - SizeFlagLarge int = 256 - SizeFlagNormal int = 128 - SizeFlagSmall int = 64 -) - -const ( - thumbVersion = "0.3" -) - -// args: src, bg, width, height, force -// rets: dest, error -type HandleType func(string, string, int, int, bool) (string, error) - -type Manager struct { - handlers map[string]HandleType - locker *sync.RWMutex -} - -var mInitializer sync.Once - -var getManager = func() func() *Manager { - var m *Manager - return func() *Manager { - mInitializer.Do(func() { - m = &Manager{ - handlers: make(map[string]HandleType), - locker: new(sync.RWMutex), - } - }) - return m - } -}() - -func Register(ty string, handler HandleType) { - err := getManager().Add(ty, handler) - if err != nil { - fmt.Println("Register failed:", err) - } -} - -func IsStrInList(item string, items []string) bool { - for _, v := range items { - if item == v { - return true - } - } - return false -} - -func GetHandler(ty string) (HandleType, error) { - handler := getManager().Get(ty) - if handler == nil { - return nil, fmt.Errorf("Cann't find generator for '%s'", ty) - } - return handler, nil -} - -func ThumbnailImage(src, dest string, width, height int) error { - err := os.MkdirAll(path.Dir(dest), 0755) - if err != nil { - return err - } - return graphic.ThumbnailImage(src, dest, width, height, - graphic.FormatPng) -} - -func ScaleImage(src, dest string, width, height int) error { - err := os.MkdirAll(path.Dir(dest), 0755) - if err != nil { - return err - } - return graphic.ScaleImagePrefer(src, dest, width, height, - graphic.FormatPng) -} - -func GetThumbnailDest(uri string, width, height int) (string, error) { - file := dutils.DecodeURI(uri) - md5, ok := dutils.SumStrMd5(file + getFileModTime(file) + thumbVersion) - if !ok { - return "", fmt.Errorf("md5sum '%s' failed", uri) - } - - var mid string - if width >= SizeFlagLarge || height >= SizeFlagLarge { - mid = "thumbnails/large" - } else if width >= SizeFlagNormal || height >= SizeFlagNormal { - mid = "thumbnails/normal" - } else { - mid = "thumbnails/small" - } - dir := path.Join(basedir.GetUserCacheDir(), mid) - err := os.MkdirAll(dir, 0700) - if err != nil { - return "", err - } - - return path.Join(dir, md5+".png"), nil -} - -func CompositeIcons(icons []string, bg, dest string, - iconSize, width, height, padding int) error { - - iconNum := len(icons) - if iconNum == 0 { - return fmt.Errorf("No icon files") - } - - var err error - if !dutils.IsFileExist(bg) { - bg, err = GetBackground(width, height) - if err != nil { - return err - } - defer os.Remove(bg) - } - - y := (height - iconSize) / 2 - spaceW := width - iconSize*iconNum - x := (spaceW - (iconNum-1)*padding) / 2 - - for _, icon := range icons { - err = graphic.CompositeImage(bg, icon, dest, x, y, graphic.FormatPng) - if err != nil { - return err - } - bg = dest - x += (iconSize + padding) - } - - return nil -} - -func GetBackground(width, height int) (string, error) { - var dest = GetTmpImage() - err := graphic.NewImageWithColor(dest, int(width), int(height), - //uint8(192), uint8(192), uint8(192), uint8(250), - uint8(250), uint8(250), uint8(250), uint8(0), - graphic.FormatPng) - if err != nil { - return "", err - } - - return dest, nil -} - -func GetTmpImage() string { - var ( - seedStr = "0123456789abcdefghijklmnopqrstuvwxyz" - ret string - ) - length := len(seedStr) - for i := 0; i < 8; i++ { - rand.Seed(time.Now().UnixNano()) - ret += string(seedStr[rand.Intn(length)]) - } - return path.Join("/tmp", ret+".png") -} - -func (m *Manager) Add(ty string, handler HandleType) error { - v := m.Get(ty) - if v != nil { - return fmt.Errorf("'%s' has been registered", ty) - } - - m.locker.Lock() - defer m.locker.Unlock() - m.handlers[ty] = handler - return nil -} - -func (m *Manager) Delete(ty string) { - m.locker.Lock() - defer m.locker.Unlock() - delete(m.handlers, ty) -} - -func (m *Manager) Get(ty string) HandleType { - m.locker.RLock() - defer m.locker.RUnlock() - handler, ok := m.handlers[ty] - if !ok { - return nil - } - - return handler -} - -func getFileModTime(file string) string { - info, err := os.Stat(file) - if err != nil { - return "" - } - - return fmt.Sprintf("%v", info.ModTime().Unix()) -} diff --git a/thumbnails/pdf/pdf.go b/thumbnails/pdf/pdf.go deleted file mode 100644 index 1aa8a3cf..00000000 --- a/thumbnails/pdf/pdf.go +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// PDF thumbnail generator -package pdf - -import ( - "fmt" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - PDFTypePDF = "application/pdf" -) - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, genPDFThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - PDFTypePDF, - } -} - -func GenThumbnail(uri string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(uri) - if err != nil { - return "", err - } - - if !IsStrInList(ty, SupportedTypes()) { - return "", fmt.Errorf("Not supported type: %s", ty) - } - - return genPDFThumbnail(uri, "", width, height, force) -} - -func genPDFThumbnail(uri, bg string, width, height int, force bool) (string, error) { - dest, err := GetThumbnailDest(uri, width, height) - if err != nil { - return "", err - } - - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - return doGenThumbnail(dutils.EncodeURI(uri, dutils.SCHEME_FILE), - dest, width, height) -} diff --git a/thumbnails/pdf/thumbnail.c b/thumbnails/pdf/thumbnail.c deleted file mode 100644 index 1095f9ca..00000000 --- a/thumbnails/pdf/thumbnail.c +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -/** - * PDF thumbnail generator - * - * Reference xfce tumbler. - **/ -#include <poppler-document.h> -#include <poppler-page.h> - -#include <cairo.h> - -static PopplerDocument* create_poppler_document(gchar* uri); -static cairo_surface_t* get_thumbnail_surface(PopplerDocument* doc, gint index); -static gint save_thumbnail(cairo_surface_t* surface, gchar* dest); -static cairo_surface_t* get_thumbnail_surface_from_page(PopplerPage* page); - -int -pdf_thumbnail(char* uri, char* dest) -{ - PopplerDocument* doc = create_poppler_document(uri); - if (!doc) { - return -1; - } - - // get the first page surface - cairo_surface_t* surface = get_thumbnail_surface(doc, 0); - g_object_unref(doc); - if (!surface) { - return -1; - } - - int ret = save_thumbnail(surface, dest); - cairo_surface_destroy(surface); - - return ret; -} - -static PopplerDocument* -create_poppler_document(gchar* uri) -{ - GError* error = NULL; - PopplerDocument* doc = poppler_document_new_from_file(uri, NULL, &error); - // TODO: if doc == NULL, create PopplerDocument from file contents - if (error) { - g_print("Open file failed: %s\n", error->message); - g_error_free(error); - return NULL; - } - - return doc; -} - -static gint -save_thumbnail(cairo_surface_t* surface, gchar* dest){ - cairo_status_t ret = cairo_surface_write_to_png(surface, dest); - if (ret != CAIRO_STATUS_SUCCESS) { - return -1; - } - - return 0; -} - -static cairo_surface_t* -get_thumbnail_surface(PopplerDocument* doc, gint index) -{ - PopplerPage* page = poppler_document_get_page(doc, index); - if (!page) { - g_printerr("Get the '%d' page failed\n", index); - return NULL; - } - - cairo_surface_t* surface = poppler_page_get_thumbnail(page); - if (!surface) { - surface = get_thumbnail_surface_from_page(page); - } - - g_object_unref(page); - return surface; -} - -static cairo_surface_t* -get_thumbnail_surface_from_page(PopplerPage* page) -{ - gdouble width, height; - poppler_page_get_size(page, &width, &height); - - cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - width, - height); - cairo_t* cr = cairo_create(surface); - cairo_save(cr); - poppler_page_render(page, cr); - cairo_restore(cr); - - cairo_set_operator(cr, CAIRO_OPERATOR_DEST_OVER); - cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); - cairo_paint(cr); - cairo_destroy(cr); - - return surface; -} diff --git a/thumbnails/pdf/thumbnail.h b/thumbnails/pdf/thumbnail.h deleted file mode 100644 index 57fe70fc..00000000 --- a/thumbnails/pdf/thumbnail.h +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __THUMBNAIL_H__ -#define __THUMBNAIL_H__ - -int pdf_thumbnail(char* uri, char* dest); - -#endif diff --git a/thumbnails/pdf/wrapper.go b/thumbnails/pdf/wrapper.go deleted file mode 100644 index b8286531..00000000 --- a/thumbnails/pdf/wrapper.go +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package pdf - -// #cgo pkg-config: poppler-glib cairo -// #cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -// #include <stdlib.h> -// #include "thumbnail.h" -import "C" - -import ( - "fmt" - "os" - "unsafe" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" -) - -func doGenThumbnail(uri, dest string, width, height int) (string, error) { - tmp := GetTmpImage() - cTmp := C.CString(tmp) - defer C.free(unsafe.Pointer(cTmp)) - cUri := C.CString(uri) - defer C.free(unsafe.Pointer(cUri)) - ret := C.pdf_thumbnail(cUri, cTmp) - if ret == -1 { - return "", fmt.Errorf("Gen thumbnail failed") - } - - defer os.Remove(tmp) - err := ThumbnailImage(tmp, dest, width, height) - if err != nil { - return "", err - } - - return dest, nil -} diff --git a/thumbnails/text/text.c b/thumbnails/text/text.c deleted file mode 100644 index fffca113..00000000 --- a/thumbnails/text/text.c +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include <gdk/gdk.h> -#include "text.h" - -#define FONT_NAME "monospace" - -static void do_show_text(cairo_t* cr, char** text, ThumbInfo* info); - -int -text_thumbnail(char** text, char* dest, ThumbInfo* info) -{ - if (!gdk_init_check(NULL, NULL)) { - g_warning("Init gdk failed"); - return -1; - } - - cairo_surface_t* surface = cairo_image_surface_create( - CAIRO_FORMAT_ARGB32, info->width, info->height); - if (!surface) { - g_warning("Create surface failed"); - return -1; - } - - cairo_t* cr = cairo_create(surface); - cairo_surface_destroy(surface); - if (!cr) { - g_warning("Create cairo failed"); - return -1; - } - - cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0); - cairo_paint(cr); - do_show_text(cr, text, info); - - cairo_status_t status = cairo_surface_write_to_png( - cairo_get_target(cr), - dest); - cairo_destroy(cr); - if (status != CAIRO_STATUS_SUCCESS) { - g_warning("Write cairo to file '%s' failed", dest); - return -1; - } - - return 0; -} - -static void -do_show_text(cairo_t* cr, char** text, ThumbInfo* info) -{ - cairo_select_font_face(cr, FONT_NAME, - CAIRO_FONT_SLANT_NORMAL, - CAIRO_FONT_WEIGHT_BOLD); - - cairo_set_font_size(cr, info->fontSize); - - // text color: black - cairo_set_source_rgb(cr, 0, 0, 0); - - int i = 0; - int y_pos = info->yborder; - while (text[i]) { - if (y_pos > info->canvasHeight) { - break; - } - - cairo_move_to(cr, info->xborder, y_pos); - cairo_show_text(cr, text[i]); - y_pos += info->fontSize; - i++; - } -} diff --git a/thumbnails/text/text.go b/thumbnails/text/text.go deleted file mode 100644 index b12b42d0..00000000 --- a/thumbnails/text/text.go +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// Text thumbnail generator -package text - -import ( - "fmt" - - . "github.com/linuxdeepin/dde-api/thumbnails/loader" - "github.com/linuxdeepin/go-lib/mime" - dutils "github.com/linuxdeepin/go-lib/utils" -) - -const ( - TextTypeText = "text/plain" - TextTypeC = "text/x-c" - TextTypeCpp = "text/x-cpp" - TextTypeGo = "text/x-go" -) - -func init() { - for _, ty := range SupportedTypes() { - Register(ty, genTextThumbnail) - } -} - -func SupportedTypes() []string { - return []string{ - TextTypeText, - TextTypeC, - TextTypeCpp, - TextTypeGo, - } -} - -func GenThumbnail(src string, width, height int, force bool) (string, error) { - if width <= 0 || height <= 0 { - return "", fmt.Errorf("Invalid width or height") - } - - ty, err := mime.Query(src) - if err != nil { - return "", err - } - - if !IsStrInList(ty, SupportedTypes()) { - return "", fmt.Errorf("Not supported type: %v", ty) - } - - return genTextThumbnail(src, "", width, height, force) -} - -func genTextThumbnail(src, bg string, width, height int, force bool) (string, error) { - dest, err := GetThumbnailDest(src, width, height) - if err != nil { - return "", err - } - if !force && dutils.IsFileExist(dest) { - return dest, nil - } - - return doGenThumbnail(dutils.DecodeURI(src), dest, width, height) -} diff --git a/thumbnails/text/text.h b/thumbnails/text/text.h deleted file mode 100644 index 55be8a26..00000000 --- a/thumbnails/text/text.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef __TEXT_H__ -#define __TEXT_H__ - -typedef struct _THUMB_INFO -{ - int width; - int height; - int xborder; - int yborder; - int canvasWidth; - int canvasHeight; - int fontSize; -} ThumbInfo; - -int text_thumbnail(char** text, char* dest, ThumbInfo* info); - -#endif diff --git a/thumbnails/text/wrapper.go b/thumbnails/text/wrapper.go deleted file mode 100644 index 1a16fcff..00000000 --- a/thumbnails/text/wrapper.go +++ /dev/null @@ -1,167 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -// TODO: use 'code.google.com/p/freetype-go/freetype' to draw text on image -package text - -// #cgo pkg-config: gdk-3.0 -// #cgo CFLAGS: -W -Wall -fPIC -fstack-protector-all -// #include <stdlib.h> -// #include "text.h" -import "C" - -import ( - "bufio" - "fmt" - "os" - "unsafe" - - "github.com/linuxdeepin/dde-api/thumbnails/loader" -) - -type thumbInfo struct { - width int - height int - xborder int - yborder int - canvasWidth int - canvasHeight int - pixelsize int - fontsize int -} - -const ( - defaultDPI int = 96 - defaultScale int = 1 -) - -// refer to kde text thumbnail in kde-runtime -func getThumbInfo(width, height int) *thumbInfo { - var info thumbInfo - // look good at width/height = 3/4 - if height*3 > width*4 { - info.height = width * 4 / 3 - info.width = width - } else { - info.width = height * 3 / 4 - info.height = height - } - - // one pixel for the rectangle, the rest. whitespace - info.xborder = 1 + info.width/16 //minimum x-border - info.yborder = 1 + info.height/16 //minimum y-border - - // calculate a better border so that the text is centered - // kde: canvasWidth/canvasHeight = width/height - 2 * xborder / yborder - info.canvasWidth = info.width - info.xborder - info.canvasHeight = info.height - info.yborder - - // this font is supposed to look good at small sizes - // pixelsize = Max(7, Min(10, (height - 2 * yborder) / 16)) - tmpPixel := (info.height - info.yborder) / 16 - if tmpPixel > 10 { - tmpPixel = 10 - } - info.pixelsize = tmpPixel - // pixelsize = (fontsize * scale * dpi) / 72 from fontconfig - info.fontsize = info.pixelsize * 72 / (defaultDPI * defaultScale) - - return &info -} -func doGenThumbnail(src, dest string, width, height int) (string, error) { - info := getThumbInfo(width, height) - strv, err := readFile(src, info) - if err != nil { - return "", err - } - defer freeCStrv(strv) - - tmp := loader.GetTmpImage() - cTmp := C.CString(tmp) - defer C.free(unsafe.Pointer(cTmp)) - - var cinfo *C.ThumbInfo = &C.ThumbInfo{ - width: C.int(info.width), - height: C.int(info.height), - xborder: C.int(info.xborder), - yborder: C.int(info.yborder), - canvasWidth: C.int(info.canvasWidth), - canvasHeight: C.int(info.canvasHeight), - fontSize: C.int(info.fontsize), - } - ret := C.text_thumbnail(&strv[0], cTmp, cinfo) - if ret != 0 { - return "", fmt.Errorf("Draw text on image failed") - } - - defer os.Remove(tmp) - err = loader.ThumbnailImage(tmp, dest, width, height) - if err != nil { - return "", err - } - - return dest, nil -} - -func readFile(file string, info *thumbInfo) ([]*C.char, error) { - fr, err := os.Open(file) - if err != nil { - return nil, err - } - defer func() { - _ = fr.Close() - }() - - var ( - cnt int - lines []string - ) - scanner := bufio.NewScanner(fr) - numLines := info.height / info.pixelsize - for scanner.Scan() { - if cnt >= numLines { - break - } - line := scanner.Text() - if len(line) == 0 { - continue - } - lines = append(lines, line) - cnt += 1 - } - if len(lines) == 0 { - return nil, fmt.Errorf("Empty file") - } - - bytesPerLine := info.width / info.pixelsize * 2 - return strvToCStrv(lines, bytesPerLine), nil -} - -func strvToCStrv(strv []string, bytesPerLine int) []*C.char { - var cstrv []*C.char - for _, str := range strv { - var tmp string - for _, ch := range str { - if len(tmp) > bytesPerLine { - cstrv = append(cstrv, C.CString(tmp)) - tmp = "" - } - // convert 'tab' to 4 space - if ch == '\t' { - tmp += " " - continue - } - tmp += string(ch) - } - cstrv = append(cstrv, C.CString(tmp)) - } - cstrv = append(cstrv, nil) - return cstrv -} - -func freeCStrv(strv []*C.char) { - for _, str := range strv { - C.free(unsafe.Pointer(str)) - } -} diff --git a/thumbnails/thumbnails.go b/thumbnails/thumbnails.go deleted file mode 100644 index 191a5e68..00000000 --- a/thumbnails/thumbnails.go +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package thumbnails - -import ( - "fmt" - - _ "github.com/linuxdeepin/dde-api/thumbnails/cursor" - _ "github.com/linuxdeepin/dde-api/thumbnails/font" - _ "github.com/linuxdeepin/dde-api/thumbnails/gtk" - _ "github.com/linuxdeepin/dde-api/thumbnails/icon" - _ "github.com/linuxdeepin/dde-api/thumbnails/images" - "github.com/linuxdeepin/dde-api/thumbnails/loader" - _ "github.com/linuxdeepin/dde-api/thumbnails/pdf" - _ "github.com/linuxdeepin/dde-api/thumbnails/text" - "github.com/linuxdeepin/go-lib/mime" -) - -func GenThumbnail(uri string, size int) (string, error) { - if size < 0 { - return "", fmt.Errorf("Invalid size: '%v'", size) - } - - ty, err := mime.Query(uri) - if err != nil { - return "", err - } - - size = correctSize(size) - return GenThumbnailWithMime(uri, ty, size) -} - -func GenThumbnailWithMime(uri, ty string, size int) (string, error) { - if size < 0 { - return "", fmt.Errorf("Invalid size: '%v'", size) - } - - handler, err := loader.GetHandler(ty) - if err != nil { - return "", err - } - - size = correctSize(size) - return handler(uri, "", size, size, false) -} - -func correctSize(size int) int { - if size < loader.SizeFlagNormal { - return loader.SizeFlagSmall - } else if size >= loader.SizeFlagLarge { - return loader.SizeFlagLarge - } else { - return loader.SizeFlagNormal - } -} diff --git a/thumbnails/thumbnails_test.go b/thumbnails/thumbnails_test.go deleted file mode 100644 index e5383c5b..00000000 --- a/thumbnails/thumbnails_test.go +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -package thumbnails - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/linuxdeepin/dde-api/thumbnails/loader" -) - -func TestCorrectSize(t *testing.T) { - assert.Equal(t, correctSize(64), loader.SizeFlagSmall) - assert.Equal(t, correctSize(128), loader.SizeFlagNormal) - assert.Equal(t, correctSize(176), loader.SizeFlagNormal) - assert.Equal(t, correctSize(256), loader.SizeFlagLarge) -}