Irc-Unix.net

Главная | Actual Topics | Обратная связь | В избранное | Сделать домашней | Антиспам ;)
Категории
 System & Utilities
 Unix News
 OS Emulator
 Developing
 Learning/Education
 Games
 Humour
Каталог статей
Все статьи

Antispam
Статьи
Биллу Гейтсу тоже предлагают избавиться ...
Вымогательство в борьбе со спамом
Календарь

December, 2018
ПнВтСрЧтПтСбВс
12
3456789
10111213141516
17181920212223
24252627282930
31
Опросы
Какой из этих ОС Вы отдаете большее предпочтение?

QNX
FreeBSD
Linux(any)
Solaris
Mac OS
Windows XP
Windows 2003
Что такое ОС? :)


Результаты
Другие опросы

Всего голосов: 327
Комментарии: 0
Ссылки

Архив Новостей
 December 2018 (4)
 November 2018 (7)
 October 2018 (13)
 September 2018 (8)
 August 2018 (8)
 July 2018 (11)
 June 2018 (13)
 May 2018 (10)
 April 2018 (14)
 March 2018 (11)
 February 2018 (13)
 January 2018 (13)
 December 2017 (14)
 November 2017 (15)
 October 2017 (19)
 September 2017 (18)
 August 2017 (13)
 February 2017 (14)
 January 2017 (19)
 December 2016 (16)
 November 2016 (16)
 October 2016 (21)
 September 2016 (18)
 August 2016 (16)
 July 2016 (16)
 June 2016 (20)
 May 2016 (18)
 April 2016 (15)
 March 2016 (22)
 February 2016 (17)
 January 2016 (15)
 December 2015 (15)
 November 2015 (22)
 October 2015 (20)
 September 2015 (17)
 August 2015 (25)
 July 2015 (20)
 June 2015 (23)
 May 2015 (21)
 April 2015 (17)
 March 2015 (19)
 February 2015 (9)
 January 2015 (23)
 December 2014 (9)
 November 2014 (13)
 October 2014 (12)
 September 2014 (18)
 August 2014 (20)
 July 2014 (10)
 June 2014 (12)
 May 2014 (12)
 April 2014 (10)
 March 2014 (22)
 February 2014 (10)
 January 2014 (8)
 December 2013 (26)
 November 2013 (53)
 October 2013 (40)
 September 2013 (48)
 August 2013 (63)
 July 2013 (56)
 June 2013 (52)
 May 2013 (49)
 April 2013 (67)
 March 2013 (74)
 February 2013 (63)
 January 2013 (62)
 December 2012 (62)
 November 2012 (66)
 October 2012 (68)
 September 2012 (48)
 August 2012 (75)
 July 2012 (60)
 June 2012 (71)
 May 2012 (69)
 April 2012 (85)
 March 2012 (86)
 February 2012 (90)
 January 2012 (81)
 December 2011 (103)
 November 2011 (118)
 October 2011 (74)
 September 2011 (2)
 June 2011 (110)
 May 2011 (118)
 April 2011 (111)
 March 2011 (112)
 February 2011 (101)
 January 2011 (119)
 December 2010 (117)
 November 2010 (118)
 October 2010 (131)
 September 2010 (117)
 August 2010 (226)
 July 2010 (351)
 June 2010 (305)
 May 2010 (319)
 April 2010 (343)
 March 2010 (329)
 February 2010 (311)
 January 2010 (312)
 December 2009 (266)
 November 2009 (156)
 July 2009 (101)
 June 2009 (279)
 May 2009 (365)
 April 2009 (348)
 March 2009 (347)
 February 2009 (323)
 January 2009 (318)
 December 2008 (237)
 November 2008 (155)
 October 2008 (334)
 September 2008 (310)
 August 2008 (343)
 July 2008 (362)
 June 2008 (322)
 May 2008 (456)
 April 2008 (1276)
 March 2008 (1658)
 February 2008 (250)
 January 2008 (6)
 November 2007 (1)
 September 2007 (1)
 June 2007 (1)
 May 2007 (1)
 March 2007 (1)
 January 2007 (2)
 December 2006 (1)
 October 2006 (2)
 September 2006 (1)
 August 2006 (2)

Aaron Seigo (aseigo): Plasma Packages

System & Utilities Face of Aaron Seigo (aseigo)Here's another of the topics I was going to show in the screencast: Packages. The test case was getting Apple's Dashboard Widgets to work out of the box. The rules were that we couldn't adjust any of the Plasma infrastructure at all .. it has to all work with Packages and ScriptEngines. This meant changing and improving a few things in those parts of Plasma but the result was .. well, let's take a look:



In the Add Widgets dialog the Install New Widgets button is now a menu, letting you choose between downloading from the Internet using GetHotNewStuff and DXS (where what you are about to see is even more automated) or opening a widget from a file. Our test case was the Hello World widget example from Apple.

When you select the "Open From File" entry you get this:



It's an assistant dialog that lists all known packages. It doesn't list all known applet types because to the user it shouldn't matter whether a widget is implemented in Python, Ruby, ECMA Script, XTHML+JavaScript or what-not. If they behave the same and load the same then to the user they are the same. The difference here is the package type: Apple's widgets are different from Plasma's native widgets in how they are packed up and they appear to the user as different.

I'd like to eventually automate this by trying to get plasma to figure out what kind of package it is automatically. Unfortunately right now we don't have mimetype detection for different kinds of widgets and I just haven't done enough research with all the possible package types before me to do this. This is something I want to look into for 4.2 (unless someone beats me to it, of course).

Anyways, the way we get this listing is Plasma queries for all known widget types. Every widget type advertises what "language" it is; for Mac Dashboard support the language is "dashboard". Every widget type may also advertise what sort of package structure it uses. Here's the .desktop file contents for Mac Dashboard:

[Desktop Entry]
Encoding=UTF-8
Name=Dashboard
Comment=MacOS X dashboard widget
Type=Service
ServiceTypes=Plasma/ScriptEngine
Icon=internet-web-browser

X-KDE-Library=plasma_appletscriptengine_dashboard
X-KDE-PluginInfo-Author=Zack Rusin
X-KDE-PluginInfo-Email=zackr@kde.org
X-KDE-PluginInfo-Name=dashboard
X-KDE-PluginInfo-Version=pre0.1
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Applet
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=BSD
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-ComponentTypes=Applet
X-Plasma-Language=dashboard
X-Plasma-PackageFormat=dashboard


Currently Plasma has package structures for wallpapers, Plasma themes and widgets. New ones can be added at runtime, however. If the package structure is static, which is to say the files are always in the same place in the package, you can do this with a simple rc file. The PackageStructure class can read and write these files as well. If the package is not static, then you can instead provide a C++ plugin that manages this. Also, if the package requires special installation routines the same C++ plugin can provide that. Both are true in the case of the Mac Dashboard widget support.

So when a Mac Dashboard widget is opened up, Plasma looks at the X-Plasma-PackageFormat entry and goes off in search of the dashboard package format. It finds it here:

[Desktop Entry]
Encoding=UTF-8
Name=Dashboard Widget
Comment=MacOS dashboard widget
Type=Service
ServiceTypes=Plasma/PackageStructure

X-KDE-Library=plasma_packagestructure_dashboard
X-KDE-PluginInfo-Author=Zack Rusin
X-KDE-PluginInfo-Email=zackr@kde.org
X-KDE-PluginInfo-Name=dashboard
X-KDE-PluginInfo-Version=pre0.1
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Applet
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=BSD
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-PackageFileFilter=*
X-Plasma-PackageFileMimetypes=application/zip


Mimetypes and filters for the file selection are defined, as is the library and plugin name by which to load it. At this point Plasma can now call the install method which looks like this in the dashboard package structure plugin:


bool Bundle::installPackage(const QString &archivePath,
const QString &packageRoot)
{
QFile f(archivePath);
f.open(QIODevice::ReadOnly);
m_data = f.readAll();
f.close();
open();

if (m_isValid) {
m_tempDir->setAutoRemove(false);
QString pluginName = \"dashboard_\" + m_bundleId;
//kDebug() \"valid, so going to move it in to\" pluginName;
KIO::CopyJob* job = KIO::move(m_tempDir->name(), packageRoot + pluginName,
KIO::HideProgressInfo);
m_isValid = job->exec();

if (m_isValid) {
//kDebug() \"still so good ... registering\";
Plasma::PackageMetadata data;
data.setName(m_name);
data.setDescription(m_description);
data.setPluginName(pluginName);
data.setImplementationLanguage(\"dashboard\");
Plasma::Package::registerPackage(data, m_iconLocation);
}
}

if (!m_isValid) {
// make sure we clean up after ourselves afterwards on failure
m_tempDir->setAutoRemove(true);
}

return m_isValid;
}


What's happening in the code above is that Bundle opens the file at archivePath and makes sure it does indeed have the needed contents. It then copies it to packagRoot and registers the widget. Reigstration is accomplished by creating a PackageMetadata object, setting the relevant fields and passing it to Package::registerPackage, optionally along with the path to an icon for it. This creates an entry in the ksycoca database using a .desktop file that looks exactly like a native Plasma widget, except that this one is marked as being in the "dashboard" language.

This process all happens fairly well instantly and the result is that the widget appears in the widget listing alongside all the others:



The user sees no real difference. Places on the canvas we get:



As with native Plasmoids you can rotate it, resize it, drag it around to wherever you want, etc. Corona, Containment and even Applet are all blithely unaware anything different is going on. Zack was downloading various widgets from apple.com and trying them out and they tended to Just Work(tm).

(There are some issues currently with QtWebkit and these widgets (such as the white background and incorrect starting size), but Zack has pushed fixes for those upstream and those should be trickling down soon.)

Remember, however, that this is not specific to Mac Dashboard widgets. We can do this for any widget type we want. Indeed, Zack went ahead and did up a "native" webkit based widget for Plasma. As with Mac Dashboard widgets you do it all in HTML and use JavaScript within the webpage itself to manipulate it. Unlike Mac Dashboard, you can access Plasma goodies ... like DataEngines. So from embedded JavaScript you can fetch data from an engine and display it on your web based widget. Langauge type is "webkit". Nice.

(In fact, the Package stuff isn't specific to widgets at all. We could apply this to all sorts of after-market application add-ons.)

If you would like to add other types of widgets, I'd be happy and interested to both help you out and get resulting code into svn. Google Gadgets, Yahoo widgets, Windows Vista widgets, Opera Widgets ... they are all game. While they won't have all the features of the native Plasma widgets or cover the same kinds of topics, it would be great to be able to give people access to the whole world of widgets on their desktop.

Be Free to use the widgets you want, we have no agendas to push here.



  


Разместил: Planet KDE | Дата: 02.03.2008 | Прочитано: 1153 | Раздел: System & Utilities   

Рейтинг статьи

Средняя оценка: 0.00/0Средняя оценка: 0Всего голосов:0

Отлично
Хорошо Нормально Пойдёт Плохо


Смотрите также связанные темы

07.09.2008 Seigo on Plasma, Context and Nepomuk
KDE's Aaron Seigo has published a blog post in which he details how Nepomuk and the semantic desktop can be beneficial to users.
15.10.2010 E-mail
In his lengthy and interesting blog post covering the future of Plasma, KDE's Aaron Seigo proposes Qt Quick and QML as replacement of the Graphics View architecture currently used by Plasma.
29.01.2012 New Spark Tablet To Come Loaded With KDE's Active Plasma Interface
According to Aaron J. Seigo, 'It's the first tablet computer that comes with Plasma Active pre-installed.' The Spark, with its 7" screen, is built around a Cortex A9 with a Mali-400-gpu, 512MB RAM and an SD-card slot.
12.04.2011 KDE запускает проект Plasma Active для различных устройств
Вчера Арон Сейго (Aaron Seigo), разработчик из проекта рабочей среды KDE, объявил о запуске череды блоговых публикаций, посвященных новой инициативе, — Plasma Active.Идея Plasma Active — создать пользовательский интерфейс для современных мобильных устройств вроде планшетных компьютеров, мультимедийных центров и смартфонов. В основу ее дизайна заложен декларативный язык разметки Plasma Quick, позволяющий создавать интерфейс с помощью QML из Qt Quick.Plasma Active станет объединением ряда более узконаправленных проектов, таких как анонсированный Contour. Contour призван привнести «новую и захват...
02.02.2012 Анонсирован Spark — планшет с Mer (MeeGo) и KDE Plasma за 200 евро
Известный разработчик из проекта KDE Арон Сейго (Aaron Seigo) анонсировал первый в мире планшет с предварительно установленным графическим окружением KDE Plasma Active — Spark.В качестве управляющей операционной системы в Spark используются наработки проекта Mer — форка свободной мобильной платформы MeeGo. Известные на данный момент технические характеристики планшета Spark таковы: 7-дюймовый емкостной multitouch-дисплей, процессор ARM от AMLogic с тактовой частотой 1 ГГц, Mali-400 GPU, 512 мегабайт оперативной памяти, 4 Гб для хранения данных и слот для SD-карт, поддержка Wi-Fi. Стоимость нов...
12.05.2008 Plasma question for Aaron
Linked by Thom Holwerda on Sat 14th Jul 2007 20:06 UTC, submitted by AdamW "PC users have volumes of information saved on their computers, most of it disconnected and disparate save for a basic directory ...
04.03.2008 OpenGTL and QtCTL 0.9.1
A new release of JIT thanks to the use of the Aaron's feeling xvidcap hangs on debian, and I couldn't find out to make recordmydesktop records only a small part of a screen, and just the thought of post-editing scares me, yeah I am easily scared, but if you blink fast and can synchronize your blinking with the scrolling, you can see a short animation below !).
28.06.2008 'Aaron, we owe you' or 'Why I am happy that Nepomuk is not as popular as Plasma'
Submitted by trueg on Thu, 06/26/2008 - 09:50. After more than two weeks of vacation I read up on my email and of course am also sickened by some of the stuff I have to read there.
28.01.2009 Torvalds, KDE 4, and the Media Circus
"Torvalds' comment produced a flood of response across the web, including an apologia from leading KDE developer Aaron Seigo.
15.01.2011 Opinion: Why KDE is People, Not Software
"As the first of several opinion pieces exploring current issues in KDE, we offer you a video of Aaron Seigo explaining how KDE's success as a community producing all kinds of software led to outgrowing our old name, the "K Desktop Environment", what KDE means now and why it matters.
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search
Google

Web irc-unix.net

Топ Новостей
1: Fedora and KDE/spin\'s treatment - Discussion
Hot NEWS!
Просмотров - 3101


2: Offline Vaults for an extra layer of protection
Просмотров - 775

3: KDE\'s Kirigami 2.0 Framework for Convergent UIs Enters Beta with New Features
Просмотров - 755

4: Akonadi/KMail issues on Tumbleweed?
Просмотров - 681

5: Netrunner Desktop 16.09 "Avalon" Linux OS Is Out with Kernel 4.7, KDE Plasma 5.7
Просмотров - 657

6: Debugging issues booting a PC in 2018
Просмотров - 655

7: KDevelop 5.0.2 released for Windows and Linux
Просмотров - 641

8: plib3.gui 0.9.9
Просмотров - 625

9: Konstruct
Просмотров - 613

10: Best Desktop Environment
Просмотров - 597

11: KDE Connect – State of the union
Просмотров - 594

12: KDE Connect Sprint
Просмотров - 590

13: Come dine with the KDE e.V. board in Berlin in October
Просмотров - 589

14: Help Canonical Test GNOME Patches, Android Apps Illegally Tracking Kids, MySQL 8.0 Released and More
Просмотров - 581

15: Multi-screen woes in Plasma 5.7
Просмотров - 580

Google 120X240
Ссылки

Главная | Actual Topics | Статьи | Обратная связь | Guest Book
Генерация: 1.696 сек. и 13 запросов к базе данных за 1.614 сек.
Powered by SLAED CMS © 2005-2007 SLAED. All rights reserved.