This release aims to start the migration from MOTIF to GTK user interface. It implements features needed to use AMAYA just like a browser and not like an Editor/Browser. In further release, I hope that a Browser/Editor version will be avaliable. We make this GTK release in order to get some feedback, and maybe some contribution to help the current development. I know there is a lot of bug in it, and I hope that most of them will be fixed soon.
Amaya (GTK) Screenshot
You can find it on: ftp://ftp.gtk.org/pub/gtk/v1.2
Dynamic widget creation, built on the thotlib kernel.
New flat button Look :o)
How did I proceed to implement GTK, in AMAYA sources ? First of all, I have learned the GTK lib by compiling a lot of small and easy codes. When I was partially ok with GTK lib, I looked the thotlib sources. It was not easy but I finaly understand globally how work thotlib. Looking and understanding the thotlib code was the harder job.
Now, I can start to work and produce something.
I choose to generate all form dialogue by using the thotlib functions used by motif. Motif is able to produce widget dynamically, Windows is not able to, and GTK is able to. So thotlib function was able to generate dynamically Motif widget. My work was just to replace the Motif code by the GTK equivalent code !!
w = AddInFormulary (parentCatalogue, &i, &ent, &adbloc); /* Reserve one place in the dialogue box and return a pointer on this container (w) */
#ifndef _GTK
n = 0;
title_string = XmStringCreateSimple (text);/* Create a Motif string in order to put the label into */
XtSetArg (args[n], XmNfontList, DefaultFont);/* Assigne the label Font */
n++;
XtSetArg (args[n], XmNlabelString, title_string);/* Assigne the string to the label */
n++;
XtSetArg (args[n], XmNbackground, BgMenu_Color);/* Put the label color backgroung */
n++;
XtSetArg (args[n], XmNforeground, FgMenu_Color);/* Put the label color foreground */
n++;
w = XmCreateLabel (w, "Dialogue", args, n); /* Create the label widget, and put it in the reserved container (w)*/
#else /* _GTK */
tmpw = gtk_label_new (text); /* Create the label widget */
gtk_misc_set_alignment (GTK_MISC (tmpw), 0.0, 0.5); /* Left justify the label */
gtk_widget_show (GTK_WIDGET(tmpw)); /* Show the label */
tmpw->style->font=DefaultFont;/* Assigne the label Font */
gtk_box_pack_start (GTK_BOX(w), GTK_WIDGET(tmpw), FALSE, FALSE, 0);/* Put the label in the reserved container */
w=tmpw;/* w become the pointer on the label widget */
#endif /* !_GTK */
/* Initialise the thotlib structure catalogue */
catalogue->Cat_Widget = w;
catalogue->Cat_Ref = ref;
catalogue->Cat_Type = CAT_LABEL;
catalogue->Cat_PtParent = parentCatalogue;
adbloc->E_ThotWidget[ent] = (ThotWidget) (catalogue);
adbloc->E_Free[ent] = 'N';
catalogue->Cat_EntryParent = i;
catalogue->Cat_Entries = NULL;
I have adopted the same strategie for all the thotlib functions with some XWindow & Motif reference. I try to find the correct function which could do the same action in GTK. Sometime no function was avaliable. Also, I try to make the equivalent function with many other GTK function.
This job is not easy because you must understand the thotlib function aim and find the right GTK function which could be used to do the same action.
It's the amaya kernel also in LINUX and in WINDOWS version.
It's the lib used to make the link between AMAYA and the network. (HTTP, FTP protocols)
It's an element which is used to build a dialogue. It's could be a button, a label, an editbox, a window...
Last modified: 10 July; 2001