--- rpl/src/encart.c 2017/08/24 07:07:38 1.65 +++ rpl/src/encart.c 2020/01/10 11:15:42 1.74 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.28 - Copyright (C) 1989-2017 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.32 + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -40,6 +40,7 @@ valeur_erreur(logical1 nouvelle_valeur) return(registre); } +#ifdef MOTIF_SUPPORT static int _XlibErrorHandler(Display *display, XErrorEvent *event) { @@ -53,6 +54,7 @@ _XtWarningHandler(String message) { return; } +#endif void encart(struct_processus *s_etat_processus, integer8 duree) @@ -84,15 +86,14 @@ encart(struct_processus *s_etat_processu int y_max; int y_min; - Pixel couleur_arriere_plan; - Pixel couleur_avant_plan; - Pixmap pixmap_rpl; Pixmap pixmap_rpl_masque; Position hauteur_popup; Position largeur_popup; + Screen *screen; + String *argv; struct timespec attente; @@ -147,6 +148,21 @@ encart(struct_processus *s_etat_processu xmFormWidgetClass, objet_principal, NULL); + XtVaGetValues(objet_principal, + XmNmwmDecorations, &decor, + XmNmwmFunctions, &fonctions, + NULL); + + decor &= ~(MWM_DECOR_ALL + MWM_DECOR_MAXIMIZE + MWM_DECOR_RESIZEH + + MWM_DECOR_TITLE + MWM_DECOR_MENU + MWM_DECOR_BORDER); + fonctions &= ~(MWM_FUNC_ALL + MWM_FUNC_RESIZE + MWM_FUNC_CLOSE + + MWM_FUNC_MINIMIZE + MWM_FUNC_MAXIMIZE); + + XtVaSetValues(objet_principal, + XmNmwmDecorations, decor, + XmNmwmFunctions, fonctions, + NULL); + cadre = XtVaCreateManagedWidget("rplExternalFrame", xmFrameWidgetClass, form, XmNtopAttachment, XmATTACH_FORM, @@ -161,15 +177,9 @@ encart(struct_processus *s_etat_processu XmNmarginHeight, 5, NULL); - XtVaGetValues(form, - XmNforeground, &couleur_avant_plan, - XmNbackground, &couleur_arriere_plan, - NULL); - -uprintf("0\n"); if ((erreur = XpmCreatePixmapFromData(XtDisplay(form), DefaultRootWindow(XtDisplay(form)), rpl_xpm, - &pixmap_rpl, &pixmap_rpl_masque, NULL)) != 0) + &pixmap_rpl, &pixmap_rpl_masque, NULL)) != XpmSuccess) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -181,22 +191,6 @@ uprintf("0\n"); XmNlabelPixmap, pixmap_rpl, NULL); - XtVaGetValues(objet_principal, - XmNmwmDecorations, &decor, - XmNmwmFunctions, &fonctions, - NULL); - - decor &= ~(MWM_DECOR_ALL + MWM_DECOR_MAXIMIZE + MWM_DECOR_RESIZEH - + MWM_DECOR_TITLE + MWM_DECOR_MENU + MWM_DECOR_BORDER); - fonctions &= ~(MWM_FUNC_ALL + MWM_FUNC_RESIZE + MWM_FUNC_CLOSE - + MWM_FUNC_MINIMIZE + MWM_FUNC_MAXIMIZE); - - XtVaSetValues(objet_principal, - XmNmwmDecorations, decor, - XmNmwmFunctions, fonctions, - NULL); - -uprintf("1\n"); if (XineramaIsActive(display) == True) { // Récupération de la localisation des différents écrans @@ -289,7 +283,6 @@ uprintf("1\n"); offset_x = 0; offset_y = 0; } -uprintf("2\n"); #if 0 XtRealizeWidget(objet_principal); @@ -316,10 +309,8 @@ uprintf("2\n"); XtRealizeWidget(objet_principal); #endif -uprintf("3\n"); XFlush(XtDisplay(form)); -uprintf("3a\n"); attente.tv_sec = 0; attente.tv_nsec = 1000; @@ -328,16 +319,11 @@ uprintf("3a\n"); do { -uprintf("3b\n"); if (XtAppPending(app) != 0) { -uprintf("3c\n"); XtAppNextEvent(app, &evenement); -uprintf("3d\n"); XtDispatchEvent(&evenement); -uprintf("3e\n"); } -uprintf("3f\n"); nanosleep(&attente, NULL); gettimeofday(&horodatage_final, NULL); @@ -356,9 +342,7 @@ uprintf("3f\n"); + ((double) temps_ecoule.tv_sec)) < (((double) duree) / ((double) 1000000))); -uprintf("4\n"); XtUnrealizeWidget(objet_principal); -uprintf("5\n"); while(XtAppPending(app) == 0) { @@ -372,19 +356,19 @@ uprintf("5\n"); nanosleep(&attente, NULL); } + screen = XtScreen(form); + XtDestroyWidget(pixmap); XtDestroyWidget(cadre); XtDestroyWidget(form); XtDestroyWidget(objet_principal); -uprintf("6\n"); - XmDestroyPixmap(XtScreen(form), pixmap_rpl); - XmDestroyPixmap(XtScreen(form), pixmap_rpl_masque); + XmDestroyPixmap(screen, pixmap_rpl); + XmDestroyPixmap(screen, pixmap_rpl_masque); - XCloseDisplay(display); XtAppSetWarningHandler(app, old_message_handler); XtDestroyApplicationContext(app); -uprintf("7\n"); + XCloseDisplay(display); } # endif