Project directory structure

Tomaz Canabrava tcanabrava at kde.org
Wed Apr 3 10:18:46 PDT 2013


2013/4/3 Dirk Hohndel <dirk at hohndel.org>

> Alberto Mardegan <mardy at users.sourceforge.net> writes:
>
> > On 04/03/2013 12:58 AM, Dirk Hohndel wrote:
> >>> But if you prefer, the project could standardise on underscores for all
> >>> function names, even in C++.
> >>
> >> I think that would be my STRONG preference.
> >
> > I would advise against that, at least for class members: because of
> > inheritance, our MainWindow class would inherit member functions defined
> > by QWidget and QMainWindow (supposing that we inherit from QMainWindow)
> > such as setWindowTitle().
> > Given how tight this UI code would be to Qt, I'd suggest that we keep
> > the naming of classes and members consistent with Qt (just the naming --
> > the indentation style can be our own).
>
> I guess I can see your point.
>
> > In any case, I'd like to propose that C code never calls UI code; we
> > could make the C parts behave as if it was a library, which we use from
> Qt.
>
> This sounds just like what Tomaz said. Clearly you guys are scheming
> behind our backs to take over the world :-)
>
> Seriously, though...
>
> If I think about the way the current Gtk code works, I think I have an
> idea of what you might be talking about.
>
> Today the UI code calls into the subsurface logic to get things
> done. Everything is run from the UI main event loop. Is that what you
> mean by "subsurface is a library that is called from the UI"?
>

Dirk, yes, it is.

But if you see the GTK code, GtkInterface has a callback, that calls a
bunch of methods ( that are not related to the UI ), and this methods call
methods ( that are related to the UI )

for instance,

void parse_file(const char *filename, GError **error, gboolean
possible_default_filename) updates the UI.

Parse file is 'logic', shouldn't call 'interface',

Interface calls Logic,
Interface gets the results
Interface Updates Interface.

this is good for instance if you want to replace Qt for GTK 3 in the future
:P
since the UI is not coupled, it's easy to replace.

Tomaz


> /D
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130403/65d92582/attachment.html>


More information about the subsurface mailing list