[Rezilla-commits] RezillaExtras/Aida/Docs_Input PluginSupport_EN.aida, 1.6, 1.7 PluginSupport_FR.ai
Brought to you by:
bdesgraupes
From: Bernard D. <bde...@us...> - 2006-11-24 08:56:19
|
Update of /cvsroot/rezilla/RezillaExtras/Aida/Docs_Input In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4106 Modified Files: PluginSupport_EN.aida PluginSupport_FR.aida Log Message: Doc complements Index: PluginSupport_EN.aida =================================================================== RCS file: /cvsroot/rezilla/RezillaExtras/Aida/Docs_Input/PluginSupport_EN.aida,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PluginSupport_EN.aida 1 Nov 2006 17:00:52 -0000 1.6 +++ PluginSupport_EN.aida 24 Nov 2006 08:56:16 -0000 1.7 @@ -409,26 +409,47 @@ private data which Rezilla will pass back in all its calls to interface functions. -((li after Rezilla receives acceptance and requests from the plugin, it -invokes the ((i EditResource i)) function. Through this function the -plugin receives a ((i RezHostInfo i)) structure filled by Rezilla and -containing basic information such as a ((i WindowRef i)) for the editing window, -the ((i MenuRef i)) pointers in case the plugin needs some menus, etc. +((li after Rezilla receives acceptance and requests from the plugin, it +invokes the ((i EditResource i)) function. Through this function the plugin +receives a ((i RezHostInfo i)) structure filled by Rezilla and containing +basic information such as a ((i WindowRef i)) for the editing window, the +((i MenuRef i)) pointers in case the plugin needs some menus, etc. lo)) -At this point the plugin can do its job to edit the resource. It can -populate the window with controls and graphic elements, install CarbonEvents on these controls, -etc. Note though that the plugin is not obliged to use CarbonEvents; the basic user actions -are passed to it by Rezilla with an EventRecord via the following -functions declared in the interface: +At this point the plugin can do its job to edit the resource. It can +populate the window with controls and graphic elements, install +CarbonEvents on these controls if necessary, etc. The window provided by +Rezilla is constructed in compositing mode: this makes the HIView drawing +model fully available. + +Note though that the plugin is not obliged to use CarbonEvents; the basic +user actions are passed to it by Rezilla with an EventRecord via the +following functions declared in the interface: ((i HandleMenu, HandleClick, HandleKeyDown i)) and ((i HandleCommand i)). When it is time to save the modifications made in a resource (for instance -when the user clicks on the ((i Save i)) button or attempts to close the window), -Rezilla invokes the ((i ReturnResource i)) function so that the plugin -returns the new data and then the ((i CleanUp i)) function so that it can -perform any post editing tasks, like releasing allocated memory for -instance. +when the user clicks on the ((i Save i)) button or attempts to close the +window), Rezilla invokes the ((i ReturnResource i)) function so that the +plugin returns the new data and then the ((i CleanUp i)) function so that +it terminates its editing session. +((lu +((li the ((i ReturnResource i)) function returns a handle to the data. It +also has a boolean argument named ((i releaseIt i)) to tell Rezilla who is +the owner of this handle and should dispose of it. If ((i releaseIt i)) is +set to true, Rezilla will dispose of the handle after the resource is +saved. Otherwise the plugin assumes ownership. + +((li when the ((i CleanUp i)) function is called, the plugin should perform +any post editing tasks, release allocated memory, etc. + +lu)) + +If the user clicks on the ((i Revert i)) button (if there is one!), Rezilla +invokes the ((i RevertResource i)) function: the data to revert to are +provided in the ((i inDataH i)) argument, so the plugin does not have to +worry about keeping a copy of the original data. + + ((s3 Plugin requests @@ -449,10 +470,13 @@ |)) The ((i winbounds i)) member is a Rect structure indicating the position -and dimension of the editing window. Rezilla always provides an editing -window which can be equiped with some basic controls such as a ((i Save i)) button, -a ((i Cancel i)) button etc. The plugin does not have to track these controls: they -are managed by the main application. The plugin just decides, using the +and dimension of the editing window: it is in global coordinates and +corresponds to the entire structure of the window, that is to say the +dimensions that will be passed to the ((i CreateWindow i)) toolbox +function. Rezilla always provides an editing window which can be equiped +with some basic controls such as a ((i Save i)) button, a ((i Cancel i)) +button etc. The plugin does not have to track these controls: they are +managed by the main application. The plugin just decides, using the appropriate flags, which controls should be present in the editing window. For instance, add the ((i kPluginEditorHasRevertButton i)) flag to the attributes to get a ((i Revert i)) button. Index: PluginSupport_FR.aida =================================================================== RCS file: /cvsroot/rezilla/RezillaExtras/Aida/Docs_Input/PluginSupport_FR.aida,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- PluginSupport_FR.aida 1 Nov 2006 17:00:53 -0000 1.4 +++ PluginSupport_FR.aida 24 Nov 2006 08:56:16 -0000 1.5 @@ -464,22 +464,44 @@ lo)) Ë ce stade, le plugin peut maintenant faire son travail d'dition de la -ressource. Il peut par exemple crer des contrles et des lments -graphiques, installer des -CarbonEvents sur ces contrles, etc. On notera dependant qu'il n'y a aucune -obligation utiliser des CarbonEvents; toutes les actions et vnements -dclenchs par l'utilisateur sont passs Rezilla sous la forme d'un -EventRecord dans les fonctions suivantes dfinies dans l'interface: -((i HandleMenu, HandleClick, HandleKeyDown i)) et ((i HandleCommand i)). +ressource. Il peut par exemple crer des contrles et des lments +graphiques, installer au besoin des CarbonEvents sur ces contrles, etc. La +fentre est construite en mode composite (((i compositing mode i))) ce qui +permet d'utiliser pleinement le modle HIViews de dessin de l'interface +graphique. + +On notera dependant qu'il n'y a aucune obligation utiliser des +CarbonEvents; toutes les actions et vnements dclenchs par l'utilisateur +sont passs Rezilla sous la forme d'un EventRecord dans les fonctions +suivantes dfinies dans l'interface: ((i HandleMenu, HandleClick, +HandleKeyDown i)) et ((i HandleCommand i)). Lorsque vient le moment de sauvegarder les modifications faites dans la ressource (par exemple lorsque l'utilisateur clique sur le bouton ((i Save i)) ou tente de fermer la fentre), Rezilla invoque la fonction ((i ReturnResource i)) afin que le plugin renvoie les donnes modifies, puis la fonction ((i CleanUp i)) -afin qu'il puisse excuter les tches qui mettent fin une session -d'dition, comme par exemple librer les portions de mmoire qui ont t -alloues. +afin qu'il puisse terminer sa session d'dition: +((lu +((li la fonction ((i ReturnResource i)) renvoie une ((i handle i)) sur les +donnes modifies. Elle comporte aussi un argument boolen ((i releaseIt +i)) qui indique Rezilla qui est propritaire de cette ((i handle i)) et +qui devra donc librer la mmoire qu'elle occupe. Si cet argument est fix + la valeur ((i true i)) c'est Rezilla qui est responsable de librer la +mmoire, autrement le plugin devra s'en charger. + +((li lorsque la fonction ((i CleanUp i)) est appele, le plugin excute +toutes les tches de post-dition qu'il juge ncessaire, libre la mmoire +qu'il a alloue, etc. + +lu)) + +Si l'utilisateur clique sur le bouton ((i Revert i)) (lorsqu'il y en a +un!), Rezilla invoque la fonction ((i RevertResource i)): les donnes +auxquelles il faut revenir sont fournies par l'intermdiaire de l'argument +((i inDataH i)), ce qui signifie en particulier que le plugin n'a pas se +proccuper de garder une copie des donnes originales. + ((s3 Les requtes du plugin @@ -502,14 +524,17 @@ |)) Le membre ((i winbounds i)) est une structure Rect indiquant la position et -dimension de la fentre d'dition. Rezilla fournit toujours une fentre -d'dition qui peut tre quipe d'un certain nombre d'lments de base tels -que des boutons ((i Save i)) et ((i Cancel i)). Le plugin n'a pas se -proccuper de surveiller ces contrles: ils sont grs par l'application -principale. Le plugin doit simplement dcider, au moyen des drapeaux -adquats, lesquels de ces contrles doivent figurer dans la fentre. Par -exemple, on ajoutera le drapeau ((i kPluginEditorHasRevertButton i)) aux -attributs si l'on souhaite avoir un bouton ((i Revert i)) dans la fentre. +dimension de la fentre d'dition: elle est exprime en coordonnes +globales et correspond la structure entire de la fentre, autrement les +dimensions qui sont habituellement passes la fonction ((i CreateWindow +i)). Rezilla fournit toujours une fentre d'dition qui peut tre quipe +d'un certain nombre d'lments de base tels que des boutons ((i Save i)) et +((i Cancel i)). Le plugin n'a pas se proccuper de surveiller ces +contrles: ils sont grs par l'application principale. Le plugin doit +simplement dcider, au moyen des drapeaux adquats, lesquels de ces +contrles doivent figurer dans la fentre. Par exemple, on ajoutera le +drapeau ((i kPluginEditorHasRevertButton i)) aux attributs si l'on souhaite +avoir un bouton ((i Revert i)) dans la fentre. Le membre ((i menucount i)) indique combien de menus sont ncessaires au plugin (ventuellement 0). Si le plugin dfinit des menus, il doit passer |