Domanda

I'm doing a project about migrating a legacy GUI program from Motif to Gtk. The source code is quite long (about 80k lines). Now I have two plans:

  1. Simply find the corresponding relationships bewteen the Motif functions and Gtk's. Then write some scripts to do this transform automatically. Of course, this could not be 100 percent automatically, manual work will be needed.
  2. Go back to the architecture of the GUI program from the source code. Build a tree-like structure and then use Gtk to re-build the program according to the structure.

Please give me some advice about this two plans. Any ideas or thoughts are also heartly welcomed.

È stato utile?

Soluzione

I don't know motif, but you solution 1 sounds like a very bad idea to me. Toolkits have some specific features, and just are not interchangeable. Otherwise you would have easily different frontends to software, and it's not the case, as that requires a good amount of work.

I don't really understand your solution 2, especially the tree-like structure. Is it a diagram to see which screens appear when? It would be a good idea. Taking screenshots of the current screens, merging them in a big image with arrow explaining what action leads to which screen will help you.

Then, you'll need to see if the GUI logic in clearly separate in your program, of if it's all tied. If it's tied, you're gonna have a lot of work, which will most likely be a complete reimplementation of your program in GTK!

But don't forget you can use Glade to design the GTK GUI, which will save you a good bunch of GUI creation lines of code.

As your app is 80k LOC, I think this is a big project, that may take a few months to achieve. You will need to create the GTK app skeleton, an then copy/paste the internal logic of the program. Start reimplementing screen by screen, so you can see a real improvement. If you try to do it all at once, you'll end up discouraged of seeing no progress.

All this is a personal approach, that's just how I'd do it. Other people may find better migration plans.

You may find more advice by searching on the gtk-app-devel-list mailing list (similar questions have already been asked, like this one).

Altri suggerimenti

i can remember from my old days in university i had an assignment to do a (automated) conversion from a MOTIF program to the X framework xview. I got lost in that task and did a complete rebuild.

Good luck to you

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top