Menu

Mono, Wine, and Linux question

Aaron
2007-07-25
2013-04-24
  • Aaron

    Aaron - 2007-07-25

    I am interested in using DockPanel suite on Linux.  I know DockPanel has several P/Invoke calls that make it impossible to run using mono on Linux.  However, I have heard that Wine has a dll that implements the win32 entry points.  Does anyone know if it is possible to modify DockPanel so the P/Invoke calls use the Wine win32 dll and have it all run under mono on Linux?

    Thanks,
    Aaron

     
    • Christoph

      Christoph - 2007-07-29

      Hi Aaron,

      as far as I know Mono and WINE can not interoperate directly by loading a WINE.dll. The only way  I could think of, that might work is: run Mono from inside of Wine. The only Mono-Application (=MonoDevelop) I know that has Docking support uses Gtk# :)
      A better apporach, than using WINE, would be to remove the P/Invoke calls. DockingPanel's portability suffers from two things, as far as I could guess *leading myself up the garden path*:
      1. Focus-Management (message-hooking, this change might attack the design?)
      2. Drag&Drop-Detection (straight replaceable?)

      Maybe Weifen Luo has a comment on this topic? :)

      Greetings,
      Christoph

       
      • Weifen Luo

        Weifen Luo - 2007-07-29

        DockPanel Suite relies on P-Invoke for the following (more than mentioned above):

        1. Focus management to trace the active pane and document. I can't figure out any other way which can safely achieve this other than installing a windows hook;
        2. Mdi client manipulation. The .Net Framework makes the MdiClient class a truely black box therefore we must manipulate it through its window handle;
        3. Windows message process (WndProc overide and SendMessage/PostMessage, etc). I don't know anything about Mono, but I highly doubt the window message such as WM_NCHITTEST can be ported without modification;
        4. ShowWindow to show a window without stealing the focus (in DragForm.cs);
        5. WindowFromPoint for drop detection. This can be replaced by enumerating all the docking windows, however it will be much more complicated because we need to consider the Z-orders all by ourselves.

         
    • Christoph

      Christoph - 2007-07-29

      Hi,

      First: good to see you interested in this :)

      @5. I have no clue if there is a way to obtain the Z-order of a window using .net. Managing the Z-order ourselfes should be impossible, since we don't know other windows than those of our application, right? I thought about a diffrent solution:
      1. If a DockContent is created, attach a "MouseOver" listener (?trap all controls that are being added?).
      2. If the "MouseOver" is triggered, notify the hosting DockPanel and dispatch, if necessary.
      3. ... rest should be the same.

      @4. This could be replaced by using something like this in DragForm.cs:

              protected override bool ShowWithoutActivation
              {
                  get
                  {
                      return true;
                  }
              }

      Combined somewhere with something like this:

                  DragForm window = new DragForm();
                  window.Show(parentForm);

      @3. I'm quite sure, that Mono does handle this more or less correctly. Otherwise it is patchable ;)

      @2. Can be disabled for a Linux build, until there is a solution, right?

      @1. Maybe I misunderstood you, but if its just tracking the focus:
      1. Register a lister to Form::GotFocus, Form::LostFocus
      2. If the event is triggered, notify the hosting DockPanel and dispatch, if necessary.
      3. ... rest should be the same.

      I must admit, that my reply is quite lousy, since I didn't look at your code en detail :-)

      Greetings,
      Christoph

       
  • Krish

    Krish - 2011-12-16

    Hi All,

    Anybody interested to guide a pool of talented c# developers for converting DockPanel suite to mono platform ? we have commercial reasons do that.

    It will be really nice to know the rough estimates (in hours) for the whole project. We would be happy to post the output back to this community.

     
  • Lionel

    Lionel - 2011-12-16

    Hi naicokrish,

    What do you mean by "guiding a pool of developers" ?

    If you start porting dockpanel to mono/Linux, I'd be interested as well (but I'm missing the Linux knowledge ti determine the Linux equivalent API for the P-invoke used in the code).

     
  • Ajib C K

    Ajib C K - 2011-12-19

    I am also pretty interested in using DockPanel suite on Linux.  As asked by Aaron, is there anyway to develop Dockpanel suite so that it can  be used in Mono/Linux with all its features like drag n drop and all? Can anyone guide me for this?Any help would be sincerely appreciated.

    Thanks
    Ajib

     
  • Lex Li

    Lex Li - 2011-12-21

    Please read what weifenluo wrote if you want to port this library to Mono/Linux, as he already provided enough information on what kind do knowledge is required.

     

Log in to post a comment.