Página Principal | Lista Alfabética | Lista de Componentes | Lista de Arquivos | Componentes Membros | Arquivos Membros

Referência do Arquivo drv.c

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "iup.h"
#include "iupkey.h"
#include "cd.h"
#include "wd.h"
#include "prj.h"
#include "crs.h"

Gráfico de dependência de inclusões para drv.c:

Include dependency graph

Vá para o código-fonte deste arquivo.

Project driver module.

Data:
03-Oct-2004
Autor:
Luiz F. Martha
Versão:
1.0
This file contains the driver function for the third assignment of course CIV 2801 - Fundamentos de Computacao Grafica Aplicada - 2004.2. See documentation on class notes.

Each time the model or its image is manipulated on the screen, it is redisplayed to reflect the change.

The actions are currently set by the user through key commands. Part of the assignment is to add menus and/or buttons to perform the actions.

Revisions:

  • Version 1.0 by L.F. Martha on 02-Oct-2004: Initial version.


#define ButtonPressed   1
 Defines mouse button pressed mode.

#define ButtonReleased   0
 Defines mouse button released mode.

FILE * drvOpenFile (char *mode)
 This function prompts the user for a file name and opens the file.

int drvResize (Ihandle *cv, int width, int height)
 Callback function for canvas resize event (see IUP documentation).

int drvRedisplay (Ihandle *cv)
 Callback function for canvas redisplay event (see IUP documentation).

int drvMouseBt (Ihandle *cv, int b, int mode, int x, int y, char *mousecfg)
 Callback function for mouse button event on canvas (see IUP documentation).

int drvMouseMv (Ihandle *cv, int x, int y, char *mousecfg)
 Callback function for mouse movement event on canvas (see IUP documentation).

int drvKeyCrtl (Ihandle *dg, int key)
 Callback function for keyboard event (see IUP documentation).

int main (int argc, char *argv[])
 This is the main driver of the program.

Ihandle * Omain
 Main dialog handle.

Ihandle * Otopmsg
 Handle to top message label.

char file_name [256]
 String that holds the current opened file name.

int dsp_load = 1
 Visibility flag for member loads.


Deinições e macros

#define ButtonPressed   1
 

Defines mouse button pressed mode.

Definição na linha 73 do arquivo drv.c.

#define ButtonReleased   0
 

Defines mouse button released mode.

Definição na linha 76 do arquivo drv.c.

Referenciado por drvMouseBt().


Funções

int drvKeyCrtl Ihandle *  dg,
int  key
[static]
 

Callback function for keyboard event (see IUP documentation).

This function takes an appropriate action according to the given key that was pressed by the user and passed as a parameter.

Parâmetros:
dg - handle to IUP main dialog object (in)
key - pressed key identifier (in)
Retorna:
IUP_DEFAULT value or IUP_CLOSE value (if key is CONTROL+Q)

Definição na linha 304 do arquivo drv.c.

Referências CRS_NO_STEP_TO_GO, drvOpenFile(), drvRedisplay(), dsp_load, Odatascreen, Otopmsg, prjClipboard(), prjFit(), prjHelp(), prjInfo(), prjLoadDisplay(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjPrint(), prjProcessGoThru(), prjProcessInit(), prjProcessStep(), prjQuit(), prjSaveResults(), prjZoomIn() e prjZoomOut().

Referenciado por main().

int drvMouseBt Ihandle *  cv,
int  b,
int  mode,
int  x,
int  y,
char *  mousecfg
[static]
 

Callback function for mouse button event on canvas (see IUP documentation).

Parâmetros:
cv - handle to IUP canvas object (in)
b - button identifier (in)
mode - mode (button pressed or released) (in)
x,y - mouse raster position (left-top origin) (in)
mousecfg - additional key-pressed info (not used) (in)
Retorna:
IUP_DEFAULT value

Definição na linha 218 do arquivo drv.c.

Referências ButtonReleased, CRS_FAILURE, CRS_FIXED_NODE, CRS_NO_MODEL_DEFINED, CRS_NO_STEP_TO_GO, CRS_SUCCESS, Odatascreen, Otopmsg, prjChkEmptyModel() e prjProcessNode().

Referenciado por main().

int drvMouseMv Ihandle *  cv,
int  x,
int  y,
char *  mousecfg
[static]
 

Callback function for mouse movement event on canvas (see IUP documentation).

Parâmetros:
cv - handle to IUP canvas object (in)
x,y - mouse raster position (left-top origin) (in)
mousecfg - additional key-pressed info (not used) (in)
Retorna:
IUP_DEFAULT value

Definição na linha 286 do arquivo drv.c.

Referenciado por main().

FILE* drvOpenFile char *  mode  )  [static]
 

This function prompts the user for a file name and opens the file.

Parâmetros:
mode - reading ("r") or writing ("w") mode (in)
Retorna:
Pointer to opened file

Definição na linha 94 do arquivo drv.c.

Referências file_name.

Referenciado por drvKeyCrtl().

int drvRedisplay Ihandle *  cv  )  [static]
 

Callback function for canvas redisplay event (see IUP documentation).

It redisplays the model or the help message on the canvas.

Parâmetros:
cv - handle to IUP canvas object (in)
Retorna:
IUP_DEFAULT value

Definição na linha 187 do arquivo drv.c.

Referências Otopmsg, prjChkEmptyModel(), prjHelp() e prjRedisplay().

Referenciado por drvKeyCrtl() e main().

int drvResize Ihandle *  cv,
int  width,
int  height
[static]
 

Callback function for canvas resize event (see IUP documentation).

It changes the visualization parameters according to the given canvas sizes.

Parâmetros:
cv - handle to IUP canvas object (in)
width - new canvas width (in)
height - new canvas height (in)
Retorna:
IUP_DEFAULT value

Definição na linha 170 do arquivo drv.c.

Referências prjResize().

Referenciado por main().

int main int  argc,
char *  argv[]
 

This is the main driver of the program.

The program launches an user interface window on the screen and waits for an user action.

Parâmetros:
argc - number of arguments (not used) (in)
argv - list of string arguments (not used) (in)
Retorna:
Program status: success (0) or failure (1)

Definição na linha 447 do arquivo drv.c.

Referências drvKeyCrtl(), drvMouseBt(), drvMouseMv(), drvRedisplay(), drvResize(), Odatascreen, Omain, Otopmsg e prjInit().


Variáveis

int dsp_load = 1 [static]
 

Visibility flag for member loads.

Definição na linha 70 do arquivo drv.c.

Referenciado por drvKeyCrtl().

char file_name[256] [static]
 

String that holds the current opened file name.

Definição na linha 67 do arquivo drv.c.

Referenciado por drvOpenFile().

Ihandle* Omain [static]
 

Main dialog handle.

Definição na linha 61 do arquivo drv.c.

Referenciado por main().

Ihandle* Otopmsg [static]
 

Handle to top message label.

Definição na linha 64 do arquivo drv.c.

Referenciado por drvKeyCrtl(), drvMouseBt(), drvRedisplay() e main().


Gerado em Tue Oct 5 04:55:04 2004 para Trab3 por doxygen 1.3.4