Solid Int egration avec le mat eriel sans utiliser daspirine K - - PowerPoint PPT Presentation

solid
SMART_READER_LITE
LIVE PREVIEW

Solid Int egration avec le mat eriel sans utiliser daspirine K - - PowerPoint PPT Presentation

Plan Motivations Architecture Utiliser lAPI Solid Int egration avec le mat eriel sans utiliser daspirine K evin Ottens 26 Janvier 2008 K evin Ottens Solid 1/17 Plan Motivations Architecture Utiliser lAPI Plan 1


slide-1
SLIDE 1

Plan Motivations Architecture Utiliser l’API

Solid

Int´ egration avec le mat´ eriel sans utiliser d’aspirine K´ evin Ottens 26 Janvier 2008

K´ evin Ottens — Solid 1/17

slide-2
SLIDE 2

Plan Motivations Architecture Utiliser l’API

Plan

1 Motivations 2 Architecture 3 Utiliser l’API

K´ evin Ottens — Solid 2/17

slide-3
SLIDE 3

Plan Motivations Architecture Utiliser l’API

Plan

1 Motivations 2 Architecture 3 Utiliser l’API

K´ evin Ottens — Solid 3/17

slide-4
SLIDE 4

Plan Motivations Architecture Utiliser l’API

Am´ eliorer le support mat´ eriel

Ce qui est disponible pour KDE3 D´ etection du mat´ eriel: mediamanager, medianotifier... Gestion r´ eseau: knetworkmanager, kwifimanager... Gestion de l’´ energie: kpowersave, sebas’ powermanager... Pourquoi est-ce nocif? Couvre uniquement un sous ensemble des fonctionnalit´ es Informations difficilement accessibles aux autres applications Li´ e ` a un syst` eme particulier

K´ evin Ottens — Solid 4/17

slide-5
SLIDE 5

Plan Motivations Architecture Utiliser l’API

Permettre les am´ eliorations

Nouvelles utilisations ”P´ eriph´ eriques nomades” Bluetooth d´ ej` a pr´ esent Collaboration Mat´ eriel/Logiciel Nouvelles plateformes Windows Mac OS X *BSD (le support de KDE3 n’´ etait pas parfait)

K´ evin Ottens — Solid 5/17

slide-6
SLIDE 6

Plan Motivations Architecture Utiliser l’API

Vision globale

Plusieurs domaines D´ etection du mat´ eriel, gestion du r´ eseau et de l’´ energie Chaque domaine correspond ` a un ensemble de classes Chaque domaine aura au moins un ”policy agent” Policy agents, kezako? Ils sont d´ ej` a parmi nous: knetworkmanager, mediamanager... Responsables de:

l’interaction avec l’utilisateur d’appliquer ses r´ eglages

K´ evin Ottens — Solid 6/17

slide-7
SLIDE 7

Plan Motivations Architecture Utiliser l’API

Solid

Un environnement robuste

Fiche d’identit´ e Leader : hum... oui ok... j’avoue But : Am´ eliorer l’interaction entre le mat´ eriel et les applications du bureau D´ etails techniques Architecture ` a backends ”Fake backend” pour l’´ ecriture de tests unitaires Plusieurs domaines

D´ ecouverte du mat´ eriel Gestion du r´ eseau Gestion de l’´ energie

API de haut niveau : faciliter la vie des d´ eveloppeurs

K´ evin Ottens — Solid 7/17

slide-8
SLIDE 8

Plan Motivations Architecture Utiliser l’API

Plan

1 Motivations 2 Architecture 3 Utiliser l’API

K´ evin Ottens — Solid 8/17

slide-9
SLIDE 9

Plan Motivations Architecture Utiliser l’API

S´ eparation Frontend/Backend

Frontend Backend

Factory + createObject() Object + doSomething() Object + Object() + doSomething() calls calls creates

Principe Compabilit´ e binaire assur´ ee dans le frontend Chaque objet du frontend pointe sur un objet du backend Une ”factory” est utilis´ ee pour cr´ eer les objets du backend

K´ evin Ottens — Solid 9/17

slide-10
SLIDE 10

Plan Motivations Architecture Utiliser l’API

Portabilit´ e

Backend Mac Application utilise utilise implémente utilise Backend HAL Interfaces internes HAL Backend Windows implémente Frontend implémente

K´ evin Ottens — Solid 10/17

slide-11
SLIDE 11

Plan Motivations Architecture Utiliser l’API

Satisfaire tous les besoins

libsolid (kdelibs) Couvre les besoins de 90% des applications D´ etection du mat´ eriel Tˆ aches simples pour la gestion du r´ eseau et de l’´ energie libsolidcontrol (kdebase) Couvre les besoins des 10% d’applications restantes API plus complexe et sp´ ecialis´ ee Cible les applications faisant partie de la plateforme Couvre la gestion du r´ eseau et de l’´ energie Couvre le bluetooth

K´ evin Ottens — Solid 11/17

slide-12
SLIDE 12

Plan Motivations Architecture Utiliser l’API

Plan

1 Motivations 2 Architecture 3 Utiliser l’API

K´ evin Ottens — Solid 12/17

slide-13
SLIDE 13

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (1/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Device DeviceManager Volume Storage Capability Processor Button AudioIface ... Block

K´ evin Ottens — Solid 13/17

slide-14
SLIDE 14

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Principes Le syst` eme a des Devices, chacun ayant un identifiant unique Les Devices sont organis´ es dans une hi´ erarchie Chaque Device a des interfaces de diff´ erents type L’ensemble des DeviceInterfaces d’un Device d´ ecrit ce dont il est capable Notifications Solid::DeviceNotifier::deviceAdded(QString) Solid::DeviceNotifier::deviceRemoved(QString)

K´ evin Ottens — Solid 14/17

slide-15
SLIDE 15

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() QList<Solid::Device> all = Solid::Device::allDevices();

K´ evin Ottens — Solid 15/17

slide-16
SLIDE 16

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() QList<Solid::Device> processors = Solid::Device::listFromType( Solid::DeviceInterface::Processor);

K´ evin Ottens — Solid 15/17

slide-17
SLIDE 17

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() QList<Solid::Device> usbDrives = Solid::Device::listFromQuery( "StorageDrive.bus == ’Usb’");

K´ evin Ottens — Solid 15/17

slide-18
SLIDE 18

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() Manipuler des devices Solid::Device::is<T>() Solid::Device::as<T>() Solid::Device dev = ... if (dev.is<Solid::Processor>()) { ...

K´ evin Ottens — Solid 15/17

slide-19
SLIDE 19

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() Manipuler des devices Solid::Device::is<T>() Solid::Device::as<T>() Solid::Device dev = ... if (dev.is<Solid::Camera>()) { QVariant handle = dev.as<Solid::Camera>()->driverHandle(); ...

K´ evin Ottens — Solid 15/17

slide-20
SLIDE 20

Plan Motivations Architecture Utiliser l’API

D´ ecouverte du mat´ eriel (2/3)

Qu’est-ce qu’il y a de bon l` a dedans?

Trouver des devices Solid::Device::allDevices() Solid::Device::devicesFromType() Solid::Device::devicesFromQuery() Manipuler des devices Solid::Device::is<T>() Solid::Device::as<T>() Demo, ”storage-plug” (94 lignes)

K´ evin Ottens — Solid 15/17

slide-21
SLIDE 21

Plan Motivations Architecture Utiliser l’API

R´ eseau et Energie

Arbre et Fatigue

Solid::Networking status() / statusChanged() shouldConnect() / shouldDisconnect() Solid::Powermanagement appShouldConserveResources() requestSleep() begin/stopSuppressSleep()

K´ evin Ottens — Solid 16/17

slide-22
SLIDE 22

Plan Motivations Architecture Utiliser l’API

R´ eseau et Energie

Arbre et Fatigue

Solid::Networking status() / statusChanged() shouldConnect() / shouldDisconnect() Solid::Powermanagement appShouldConserveResources() requestSleep() begin/stopSuppressSleep()

K´ evin Ottens — Solid 16/17

slide-23
SLIDE 23

Plan Motivations Architecture Utiliser l’API

R´ eseau et Energie

Arbre et Fatigue

Solid::Networking status() / statusChanged() shouldConnect() / shouldDisconnect() Solid::Powermanagement appShouldConserveResources() requestSleep() begin/stopSuppressSleep()

K´ evin Ottens — Solid 16/17

slide-24
SLIDE 24

Plan Motivations Architecture Utiliser l’API

R´ eseau et Energie

Arbre et Fatigue

Solid::Networking status() / statusChanged() shouldConnect() / shouldDisconnect() Solid::Powermanagement appShouldConserveResources() requestSleep() begin/stopSuppressSleep()

K´ evin Ottens — Solid 16/17

slide-25
SLIDE 25

Plan Motivations Architecture Utiliser l’API

R´ eseau et Energie

Arbre et Fatigue

Solid::Networking status() / statusChanged() shouldConnect() / shouldDisconnect() Solid::Powermanagement appShouldConserveResources() requestSleep() begin/stopSuppressSleep()

K´ evin Ottens — Solid 16/17

slide-26
SLIDE 26

Plan Motivations Architecture Utiliser l’API

Questions ?

K´ evin Ottens

ervin@kde.org

K´ evin Ottens — Solid 17/17