TD X-Window numero 2: graphe.c


#include <stdio.h>
#include <X11/Xlib.h>
#include "graphe.h"

#define FONT "-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1"

main(argc, argv)
    int argc;
    char **argv;
{
    Display *dpy;
    Window win;
    GC draw_gc;             /* GC to draw with */
    GC fill_gc;             /* GC to fill with */
    GC xor_gc;              /* GC to draw in xor mode */
    XFontStruct *fontstruct;        /* Font descriptor */
    XGCValues gcv;          /* Struct for creating GC */

    Node selected_node = 0;
    Edge related_edges = 0;
    int drawing = 0;
    int mouse_offset_x, mouse_offset_y;

    /* on lit le graphe */
    Graph graph = ReadGraph(stdin);

    /* on ouvre une connection avec le serveur X */
/***************   CODE A ECRIRE *******************/

    /* on charge une police pour les labels */
/***************   CODE A ECRIRE *******************/

    /* on calcule la taille des noeuds pour la police chargee */
/***************   CODE A ECRIRE *******************/

    /* on cree une fenetre */
/***************   CODE A ECRIRE *******************/

    /* on cree les 3 gc : fill_gc, draw_gc, xor_gc */
/***************   CODE A ECRIRE *******************/

    /* on gere les evenements X */
    while (1) {
    XEvent event;

/***************   CODE A ECRIRE *******************/
    }
}



michel.buffa@essi.fr