[cssed-devel] Internal changes
Brought to you by:
iagorubio
From: Iago R. <iag...@hi...> - 2004-04-14 10:58:18
|
Hi all, there're some changes in CVS that should lead in a quicker response from the autocompletion pop menu, and the selector scanner pop menu, when a dialog is show. Would be great if you could test if something got broken in the changes. For the curious: The dialogs are now stored in the window structure in a hash table. (see cssdialogs-hash.c cssdialogs-hash.h). In this hash table there're stored CssDialogsClass* structures ( see cssdialogs-class.c cssdialogs-class.h ) The search, when a keyword in any pop menu should trigger a dialog ( as "(color)" or "(font)" ), was done with a really long if .. the sentence this way. if( strcmp( keyword, "(color)") =3D=3D 0 ){ dialog =3D create_color_dialog(); .... } There were 33 sentences like this one, so the search was really time consuming. Now in the CssDialogsClass there is stored a pointer to the creation function, and the search is in just one sentence. if( (class =3D (CssDialogClass*) g_hash_table_lookup (hashtable, keyword)) !=3D NULL ){ dialog =3D class->create_function(); } This sentence does the work of the 33 previous ones. See - as example - floating-list.c 366. The old sentences are commented below the new one. ITHO we can now add more dialogs to cssed, just adding it to the hash table. It's important for the future plugable interface, so we can add dialogs at run time (instead as at compile time). This will lead in the user being able to extend cssed, without touching the code base. As example to add SVG support to cssed, that will require some SVG specific dialogs, for SVG specific sentences. In my plans, most changes to come will be driven by plugins. I think this will let us maintain cssed multi platform, without stoping developers to use other libraries than gtk+ and glib. I mean that can be a gtkhtml preview plugin (gnome), other khtml preview pluging (kde) and one gecko preview pluging (will need mozilla instaled) and each user will be able to choose the plugin that's better for his system. This way cssed will stay almost in the same point it's now, and all new features will be plugin driven. What do you think about that ? Best regards. --=20 Iago Rubio =20 - Home page * http://www.iagorubio.com=20 - Last project * http://cssed.sourceforge.net =20 - GPG Keyserv * pgp.rediris.es id=3D0x909BD4DD |