I don't understand the function of REAL and VIRTUAL document and view… in Gedit "multiviews" branch

View: New views
3 Messages — Rating Filter:   Alert me  

I don't understand the function of REAL and VIRTUAL document and view… in Gedit "multiviews" branch

by KLEIN Stéphane :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I study the source code of Gedit "multiviews" branch (http://git.gnome.org/cgit/gedit/?h=multiviews).

I don't understang the function of REAL and VIRTUAL document and view…

Example :

    enum
    {
        REAL,
        VIRTUAL,
        N_STATES
    };

    typedef struct _Binding
    {
        GeditDocument   *docs[N_STATES];
        GtkWidget       *views[N_STATES];
       
        gulong        insert_text_id[N_STATES];
        gulong        delete_range_id[N_STATES];
       
        GeditDataBinding       *bindings[LAST_PROPERTY];
    } Binding;

    typedef struct _VirtualDocument
    {
        GList       *bindings; /* List of Binding */
    } VirtualDocument;

    typedef struct _DestroyData
    {
        GtkWidget *view;
        VirtualDocument *vdoc;
    } DestroyData;

Can you write some information about this part ?

Thanks for your help,
Stephane

_______________________________________________
gedit-list mailing list
gedit-list@...
http://mail.gnome.org/mailman/listinfo/gedit-list

Re: I don't understand the function of REAL and VIRTUAL document and view… in Gedit "multiviews" branch

by Ignacio Casal Quinteiro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The main reason for this is that I am binding properties and signals between 2 views/docs.

So think that the current opened document where you want to make the split is the REAL document/view
and the one splitted (the new document) is the virtual document. We need these to know the documents/views
binded.

On Tue, Nov 10, 2009 at 10:23 AM, Klein Stéphane <stephane@...> wrote:
Hi,

I study the source code of Gedit "multiviews" branch (http://git.gnome.org/cgit/gedit/?h=multiviews).

I don't understang the function of REAL and VIRTUAL document and view…

Example :

   enum
   {
       REAL,
       VIRTUAL,
       N_STATES
   };

A simple enum.

   typedef struct _Binding
   {
       GeditDocument      *docs[N_STATES];
       GtkWidget              *views[N_STATES];

       gulong                  insert_text_id[N_STATES];
       gulong                  delete_range_id[N_STATES];

       GeditDataBinding       *bindings[LAST_PROPERTY];
   } Binding;

The binding structure, here is where it is saved the bindings and the gulongs for the signals, insert-text,
delete-range and of course are saved the 2 docs and the 2 views.

   typedef struct _VirtualDocument
   {
       GList                  *bindings; /* List of Binding */
   } VirtualDocument;

This structure is to manage several bindings, so in this way we can have several splits of the same
document. Have a look at the split function to know how things work.

   typedef struct _DestroyData
   {
       GtkWidget *view;
       VirtualDocument *vdoc;
   } DestroyData;

And this is of course the data used to free all the stuff.

Can you write some information about this part ?

Thanks for your help,
Stephane

_______________________________________________
gedit-list mailing list
gedit-list@...
http://mail.gnome.org/mailman/listinfo/gedit-list


_______________________________________________
gedit-list mailing list
gedit-list@...
http://mail.gnome.org/mailman/listinfo/gedit-list

Re: I don't understand the function of REAL and VIRTUAL document and view… in Gedit "multiviews" branch

by KLEIN Stéphane :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le Tue, 10 Nov 2009 11:45:26 +0100, Ignacio Casal Quinteiro a écrit :
>
> The main reason for this is that I am binding properties and signals between
> 2 views/docs.
>
> So think that the current opened document where you want to make the split
> is the REAL document/view
> and the one splitted (the new document) is the virtual document. We need
> these to know the documents/views

I don't understand why this code use several documents objects for one file ?

In my mind, I imagine : one document object by file, several view object.

Regards,
Stephane

_______________________________________________
gedit-list mailing list
gedit-list@...
http://mail.gnome.org/mailman/listinfo/gedit-list