Re: [gedit-list] About libgedit



On Wed, Jan 26, 2011 at 06:01:46PM +0100, Sébastien Wilmet wrote:
> Hi,
> 
> I expose here more in depth my ideas about the libgedit.
> 
> First, for me the libgedit is a framework, not a library or toolkit (we 
> could name it gedit-framework instead). A framework emphasize design 
> reuse over code reuse. It dictates the architecture of the application.  
> It defines the overall structure, its partitioning into classes and 
> objects, how they collaborate, etc. A framework captures the design 
> decisions that are common to its application domain (little summary of 
> what is said in the Design Patterns book).
> 
> And obviously the framework provides concrete classes so the application 
> doesn't need to implement common things.
> 
> Here for gedit, that means that a lot of classes should be put in the 
> framework. And since a lot of them depends of GeditApp (it is a central 
> point), my first idea was to begin with it. When I glanced through the 
> code, I saw a lot of things that is interesting for any text editor or 
> IDE. This includes almost everything, even the dialogs (except for the 
> preferences) or some little things like tab-label, statusbar, 
> rounded-frame, etc. But it includes also big classes like window, tab, 
> commands-file, etc. For the window it is more for the design than for 
> the code.
> 
> When something is specific to gedit, we create a subclass which 
> overrides some methods. That's how it would be done for other apps too 
> for adding IDE specific stuff.
> 
> As explained in this mail [1], to be able to do this framework, some 
> design patterns like an abstract factory and a bridge have to be used.
> 
> This doesn't solve the problem of what we do with the settings (see the 
> discussion here [2]).
> 
> Also, for some classes it is possible to be completely independent of 
> the framework so an application can use directly some widgets without 
> the need of using all the framework.
> 
> So what are your opinions?
> 
> [1] http://mail.gnome.org/archives/gedit-list/2011-January/msg00041.html
> [2] https://bugzilla.gnome.org/show_bug.cgi?id=640601

As said in IRC, the profiles feature have almost the same purpose. But 
to satisfy developers who want to create an independent IDE, here is 
some things it should be possible to do with gedit and profiles:

- The preferences dialog should be easier. Now to access the preferences 
of a plugin, it's too complicated IMHO. In Anjuta it's better: when a 
plugin is activated, a new tab with its preferences is displayed. But we 
can do even better, for example the profile could set its own 
preferences dialog, which would replace the default one. This custom 
dialog would obviously include the common settings of gedit.

- With profiles we should be able to open different instances of gedit 
that are completely independent. So if I have an alias gedit-vala, when 
I open a new vala file from e.g. nautilus, it should be the instance of 
gedit-vala which open the file and not another instance.
It also means that the common settings (indentation style, color scheme, 
etc) should be completely independent from each profile.

- It would also be nice that the user can create custom profiles, e.g.  
one for python, one for vala, etc. There would be a dialog to create and 
remove profiles. To edit the settings of a profile, there is the 
preferences dialog.

If this three points are feasible (when GSettings supports this), then 
the framework would have less sense.

It's mainly due to the lack of these features that I began LaTeXila as 
an independent application and that I want to make the framework.

Attachment: pgpRLIxUKoXOK.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]