summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/xmind/files')
-rw-r--r--app-misc/xmind/files/x-xmind.xml10
-rw-r--r--app-misc/xmind/files/xmind-3.4.0-config.ini20
-rw-r--r--app-misc/xmind/files/xmind-thumbnailer78
-rwxr-xr-xapp-misc/xmind/files/xmind-wrapper8
-rw-r--r--app-misc/xmind/files/xmind.schemas30
5 files changed, 146 insertions, 0 deletions
diff --git a/app-misc/xmind/files/x-xmind.xml b/app-misc/xmind/files/x-xmind.xml
new file mode 100644
index 000000000000..57292e9c689b
--- /dev/null
+++ b/app-misc/xmind/files/x-xmind.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-xmind">
+ <sub-class-of type="application/zip"/>
+ <comment>XMind Workbook</comment>
+ <alias type="application/vnd.xmind.workbook"/>
+ <generic-icon name="package-x-generic"/>
+ <glob pattern="*.xmind"/>
+ </mime-type>
+</mime-info>
diff --git a/app-misc/xmind/files/xmind-3.4.0-config.ini b/app-misc/xmind/files/xmind-3.4.0-config.ini
new file mode 100644
index 000000000000..62abbd1f31ff
--- /dev/null
+++ b/app-misc/xmind/files/xmind-3.4.0-config.ini
@@ -0,0 +1,20 @@
+#These configurations are shared among all installs. Branded For XMind 2013.
+#Tue, 05 Nov 2013 22:06:37 +0800
+
+eclipse.buildId=3.4.0.201311050558
+org.xmind.product.distribution.id=cathy_portable
+org.xmind.product.license.restrictions=
+org.xmind.debug.core.workbookSave=true
+#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
+#Tue Nov 05 22:05:55 HKT 2013
+eclipse.p2.profile=profile
+osgi.framework=file\:plugins/org.eclipse.osgi_3.8.2.v20130124-134944.jar
+osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612.jar@1\:start
+org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
+eclipse.product=org.xmind.cathy.product
+osgi.splashPath=platform\:/base/plugins/org.xmind.cathy
+osgi.framework.extensions=reference\:file\:org.eclipse.osgi.nl_da_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_de_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_es_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_fr_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_ja_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_ko_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_ru_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_sl_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_zh_4.2.0.v20121120043402.jar,reference\:file\:org.eclipse.osgi.nl_zh_TW_4.2.0.v20121120043402.jar
+osgi.bundles.defaultStartLevel=4
+eclipse.p2.data.area=@config.dir/../p2
+eclipse.application=org.xmind.cathy.application
+osgi.requiredJavaVersion=1.5
diff --git a/app-misc/xmind/files/xmind-thumbnailer b/app-misc/xmind/files/xmind-thumbnailer
new file mode 100644
index 000000000000..48eb89b8cd9a
--- /dev/null
+++ b/app-misc/xmind/files/xmind-thumbnailer
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+
+import gnomevfs
+import os
+import sys
+import zipfile
+from PIL import Image, ImageEnhance
+
+# Alter these varibles to change thumbnail look
+ICON_PATH = "/usr/share/icons/hicolor/32x32/apps/xmind.png" # Change this path to alter icons
+ICON_OPACITY = 0.6 #Opacity of the icon (between 0.0 and 1.0)
+THUMBNAIL_BACKGROUND_COLOR = "white" # Color of the background
+
+in_file_path = gnomevfs.get_local_path_from_uri(sys.argv[1])
+out_file_path = sys.argv[2]
+path_without_thumbs = os.getenv("HOME")+"/Templates"
+
+def get_icon(thumbnail_size):
+ #Load icon
+ icon = Image.open(ICON_PATH).convert("RGBA")
+ #Set it's opacity
+ icon = set_icon_opacity(icon,ICON_OPACITY)
+ #And set it's position in thumbnail
+ icon_posx=thumbnail_size[0]-icon.size[0]
+ icon_posy=thumbnail_size[1]-icon.size[1]
+ icon_width=thumbnail_size[0]
+ icon_height=thumbnail_size[1]
+ return {"image":icon,"position":(icon_posx,icon_posy,icon_width,icon_height)}
+
+def get_basic_thumbnail():
+ #Find out if the file is not in Templates directory
+ if in_file_path.find(path_without_thumbs)!=0:
+ try:
+ #Extract thumbnail from Xmind file and save it
+ zip=zipfile.ZipFile(in_file_path,mode="r")
+ picture=zip.read("Thumbnails/thumbnail.jpg")
+ zip.close()
+ thumbnail=open(out_file_path,"w")
+ thumbnail.write(picture)
+ thumbnail.write("/n")
+ thumbnail.close()
+ #Open saved thumbnail
+ image=Image.open(out_file_path).convert("RGBA")
+ if image.size[0]>200:
+ image = image.resize((200,image.size[1]*200/image.size[0]))
+ if image.size[1]>200:
+ image = image.resize((image.size[0]*200/image.size[1],200))
+ return {"suceeded":True,"image":image,"size":(image.size[0],image.size[1])}
+
+ except:
+ return {"suceeded":False}
+ else:
+ return {"suceeded":False}
+
+# Nicked from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879
+def set_icon_opacity(icon,opacity):
+ #Returns an image with reduced opacity.
+ assert opacity >= 0 and opacity <= 1
+ if icon.mode != 'RGBA':
+ icon = icon.convert('RGBA')
+ else:
+ icon = icon.copy()
+ alpha = icon.split()[3]
+ alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
+ icon.putalpha(alpha)
+ return icon
+
+thumbnail=get_basic_thumbnail()
+if thumbnail["suceeded"]:
+ background=Image.new("RGB", thumbnail["size"], THUMBNAIL_BACKGROUND_COLOR)
+ icon=get_icon(thumbnail["size"])
+ thumbnail=thumbnail["image"]
+ # Add thumbnail
+ background.paste(thumbnail, None, thumbnail)
+ # Add icon
+ background.paste(icon["image"],icon["position"],icon["image"])
+ # Save thumbnail
+ background.save(out_file_path,"PNG")
diff --git a/app-misc/xmind/files/xmind-wrapper b/app-misc/xmind/files/xmind-wrapper
new file mode 100755
index 000000000000..728edce3e24a
--- /dev/null
+++ b/app-misc/xmind/files/xmind-wrapper
@@ -0,0 +1,8 @@
+#!/bin/bash
+#XMind wrapper script, copies configuration stuff into the user's local config dir if either
+#the files aren't there or are older than the set in /opt (indicating that XMind has been upgraded)
+if [ ! -f ~/.xmind/configuration-cathy/config.ini -o ~/.xmind/configuration-cathy/config.ini -ot /opt/xmind/XMind/configuration/config.ini ]; then
+ mkdir -p ~/.xmind/configuration-cathy
+ cp -r /opt/xmind/XMind/configuration/* ~/.xmind/configuration-cathy/
+fi
+/opt/xmind/XMind/XMind
diff --git a/app-misc/xmind/files/xmind.schemas b/app-misc/xmind/files/xmind.schemas
new file mode 100644
index 000000000000..336b09ecd837
--- /dev/null
+++ b/app-misc/xmind/files/xmind.schemas
@@ -0,0 +1,30 @@
+<gconfschemafile>
+ <schemalist>
+
+ <schema>
+ <key>/schemas/desktop/gnome/thumbnailers/application@x-xmind/enable</key>
+ <applyto>/desktop/gnome/thumbnailers/application@x-xmind/enable</applyto>
+ <owner>xmind-thumb</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short></short>
+ <long></long>
+ </locale>
+ </schema>
+
+
+ <schema>
+ <key>/schemas/desktop/gnome/thumbnailers/application@x-xmind/command</key>
+ <applyto>/desktop/gnome/thumbnailers/application@x-xmind/command</applyto>
+ <owner>xmind-thumb</owner>
+ <type>string</type>
+ <default>/usr/bin/xmind-thumbnailer %u %o</default>
+ <locale name="C">
+ <short></short>
+ <long></long>
+ </locale>
+ </schema>
+
+ </schemalist>
+</gconfschemafile>