Página principal | Jerarquía de la clase | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

_owl.C

Ir a la documentación de este archivo.
00001 //===========================================================================
00002 //= _owl.C                                                   Abril del 2000 =
00003 //=-------------------------------------------------------------------------=
00004 //= Definicion de elementos GUI especificos a OWL                           =
00005 //=-------------------------------------------------------------------------=
00006 //= ADVERTENCIA: ESTE SOFTWARE NO ESTA CONCEBIDO NI DISENNADO PARA EL USO   =
00007 //= EN EQUIPO DE CONTROL EN LINEA EN ENTORNOS PELIGROSOS QUE REQUIERAN UN   =
00008 //= DESEMPENNO LIBRE DE FALLAS, COMO LA OPERACION DE PLANTAS NUCLEARES,     = 
00009 //= SISTEMAS DE NAVEGACION O COMUNICACION EN AVIONES, TRAFICO AEREO,        =
00010 //= EQUIPO MEDICO DEL CUAL DEPENDAN VIDAS HUMANAS O SISTEMAS DE ARMAMENTO,  =
00011 //= EN LOS CUALES UNA FALLA EN EL SOFTWARE PUEDA IMPLICAR DIRECTAMENTE LA   =
00012 //= MUERTE, DANNOS PERSONALES O DANNOS FISICOS Y/O AMBIENTALES GRAVES       =
00013 //= ("ACTIVIDADES DE ALGO RIESGO").                                         =
00014 //=-------------------------------------------------------------------------=
00015 //= Autor original: Oscar J. Chavarro G.  A.K.A. JEDILINK. Copyright (c),   =
00016 //= 1997 - 2003, oscarchavarro@hotmail.com                                  =
00017 //= AQUYNZA es software libre, y se rige bajo los terminos de la licencia   =
00018 //= LGPL de GNU (http://www.gnu.org). Para mayor informacion respecto a la  =
00019 //= licencia de uso, consulte el archivo ./doc/LICENCIA en la distribucion. =
00020 //===========================================================================
00021 
00022 #include "jed_defs.h"
00023 
00024 #include <stdio.h>
00025 #include <string.h>
00026 #include <stdlib.h>
00027 #include "jed_gl.h"
00028 #include "framework/gui/_owl.h"
00029 #include "lista.cc"
00030 
00031 //===========================================================================
00032 //= Chequeo de activacion de esta interfaz                                  =
00033 //===========================================================================
00034 
00035 #ifndef OWL_ENABLED
00036 
00037 JED_GUI_CLASE_NULA(JED_OWL_INTERFACE, "JED_OWL_INTERFACE",
00038     "OWL", "Borland OWL", "OWL_ENABLED");
00039 
00040 #endif
00041 
00042 #ifdef OWL_ENABLED
00043 
00044 #include <vcl.h>
00045 
00046 //===========================================================================
00047 //= CLASES UTILITARIAS OWL                                                 =
00048 //===========================================================================
00049 
00050 // ...
00051 
00052 //===========================================================================
00053 //= Variables globales                                                      =
00054 //===========================================================================
00055 
00056 JED_OWL_INTERFACE *INTERFACE_Aquynza = NULL;
00057 
00058 // Manejadores de las funciones callback de aplicacion (apuntadores a funcion)
00059 int  (*OWLGUI_ejecutor_callback)(int idc, int context_id);
00060 void (*OWLGUI_draw_callback)(int);
00061 int  (*OWLGUI_tick_callback)(int);
00062 void (*OWLGUI_resize_callback)(int x_tam, int y_tam, int);
00063 int  (*OWLGUI_keyboard_callback)(EVENTO_GUI *e, int);
00064 int  (*OWLGUI_mouse_callback)(EVENTO_GUI *e, int);
00065 void (*OWLGUI_multiview_callback)(int operacion, int id_vista,
00066              char *detalles, char *menu, char *botonera);
00067 
00068 //===========================================================================
00069 //= Prototipos                                                              =
00070 //===========================================================================
00071 
00072 //===========================================================================
00073 //= Constantes y macros                                                     =
00074 //===========================================================================
00075 
00076 #define VERIFICAR(o)                                                    \
00077     if ( !(o) ) {                                                       \
00078         fprintf(stderr, "<OWL> - ERROR FATAL: No hay memoria!\n");      \
00079         fflush(stderr);                                                 \
00080         exit(-1);                                                       \
00081     }
00082 
00083 //===========================================================================
00084 //= Funciones que definen el comportamiento por defecto                     =
00085 //===========================================================================
00086 
00087 static void quit_callback(int /*param*/) { exit(1); }
00088 static void pintar_nulo(int /*context_id*/) { ; }
00089 static void resize_nulo(int /*x*/, int /*y*/, int /*context_id*/) { ; }
00090 static void idle_nulo(void) {
00091 /* if (QUIERO_pintarme!=0 && !CON_glide) glut_draw_callback(); */}
00092 static int  evento_nulo(EVENTO_GUI * /*e*/, int /*context_id*/) { return 0; }
00093 
00094 //===========================================================================
00095 //= Funciones callback para OWL                                             =
00096 //===========================================================================
00097 
00098 //===========================================================================
00099 //= Clase JED_OWL_INTERFACE                                                 =
00100 //===========================================================================
00101 
00102 JED_OWL_INTERFACE::JED_OWL_INTERFACE()
00103 {
00104     OWLGUI_draw_callback = pintar_nulo;
00105     OWLGUI_tick_callback = NULL;
00106     OWLGUI_mouse_callback = evento_nulo;
00107     OWLGUI_keyboard_callback = evento_nulo;
00108     OWLGUI_resize_callback = resize_nulo;
00109     OWLGUI_multiview_callback = NULL;
00110     OWLGUI_ejecutor_callback = NULL;
00111 /*
00112     BUFFER_doble = TRUE;
00113     _xtam = 320;
00114     _ytam = 240;
00115     _nombre = NULL;
00116 */
00117 }
00118 
00119 JED_OWL_INTERFACE::~JED_OWL_INTERFACE()
00120 {
00121     ;
00122 }
00123 
00124 void JED_OWL_INTERFACE::solicitar_repintado(void){;}
00125 
00126 void JED_OWL_INTERFACE::set_draw_callback( void (*p)(int context_id) )
00127 { OWLGUI_draw_callback = p; }
00128 
00129 void JED_OWL_INTERFACE::set_tick_callback( int (*p)(int context_id) )
00130 { OWLGUI_tick_callback = p; }
00131 
00132 void JED_OWL_INTERFACE::set_keyboard_callback( 
00133  int (*p)(EVENTO_GUI *e, int context_id) )
00134 { OWLGUI_keyboard_callback = p; }
00135 
00136 void JED_OWL_INTERFACE::set_mouse_callback( 
00137      int (*p)(EVENTO_GUI *e, int context_id) )
00138 { OWLGUI_mouse_callback = p; }
00139 
00140 void JED_OWL_INTERFACE::set_resize_callback(
00141  void (*p)(int x_tam, int y_tam, int context_id) )
00142 { OWLGUI_resize_callback = p; }
00143 
00144 void JED_OWL_INTERFACE::set_ejecutor( int (*p)(int idc, int context_id) )
00145 { OWLGUI_ejecutor_callback = p; }
00146 
00147 void JED_OWL_INTERFACE::set_multiview_callback(void (*p)(int operacion, 
00148     int id_vista, char *detalles, char *menu, char *botonera) )
00149 { OWLGUI_multiview_callback = p; }
00150 
00151 BOOLEAN
00152 JED_OWL_INTERFACE::crear(int * /*Argc*/, char * /*argv*/ [],
00153                           int /*x_tam*/, int /*y_tam*/, char * /*nombre*/)
00154 {
00155     //----------------------------------------------------------------------
00156     leer_gui("etc/spanish.gui");
00157 
00158     return TRUE;
00159 }
00160 
00161 #ifdef NONONO
00162 void
00163 JED_OWL_INTERFACE::crear_ventana_glut(void)
00164 {
00165     //- Arma y asocia un menu para la ventana -------------------------------
00166     MENU *Global = resolver_menu(menu);
00167     int menu_glut;
00168 
00169     if ( lista_menus.tam() > 0 && Global ) {
00170         menu_glut = Global->crear_glut(glut_menu_callback);
00171       }
00172       else {
00173         menu_glut = glutCreateMenu(quit_callback);
00174         glutSetMenu(menu_glut);
00175         glutAddMenuEntry("Salir", 666);
00176     }
00177 
00178     glutSetMenu(menu_glut);
00179     glutSetWindow(Nueva_ventana->id);
00180     glutAttachMenu(GLUT_RIGHT_BUTTON);
00181 
00182     //- Anexa la ventana a la lista de ventanas ----------------------------
00183     LAS_ventanas.anx(Nueva_ventana);
00184     glutSetWindow(Nueva_ventana->id);
00185 }
00186 #endif
00187 
00188 
00189 void
00190 JED_OWL_INTERFACE::ejecutar(void)
00191 {
00192     //-----------------------------------------------------------------------
00193     Application->Run();
00194 }
00195 
00196 void
00197 JED_OWL_INTERFACE::finalizar(void)
00198 {
00199 //    exit(1);
00200 }
00201 
00202 BOOLEAN
00203 JED_OWL_INTERFACE::anexar_controles(LISTA <CONTROL_GUI *> * /*Controles*/, 
00204                               REPOSITORIO_DE_ENTIDADES * /*Repositorio*/)
00205 {
00206     fprintf(stderr, "<JED_INTERFACE> ERROR: Los controles GUI no estan\n"
00207         "    implemetados en la interface actual.  Intente Motif.\n");
00208     fflush(stderr);
00209     return FALSE;
00210 }
00211 
00212 #endif // OWL_ENABLED
00213 
00214 //===========================================================================
00215 //= EOF                                                                     =
00216 //===========================================================================
00217 

Este archivo HTML ha sido generado automáticamente a partir del código fuente AQUYNZA. NO LO EDITE. Para mayor información contacte al autor.