Referência ao ficheiro src/interface/vapiGtkInterface.h

#include <gtk/gtk.h>
#include <glade/glade.h>
#include <cv.h>
#include <cvaux.h>
#include <highgui.h>
#include "vapi.h"
#include "vapiMacro.h"
#include "vapiCameraSettings.h"
#include "vapiMacroList.h"
#include "vapiOperationList.h"

Diagrama de dependências de inclusão para vapiGtkInterface.h:

Este grafo mostra quais são os ficheiros que incluem directamente ou indirectamente este ficheiro:

Ir para o código fonte deste ficheiro.

Estruturas de Dados

struct  _vapiCalibrateCamera
struct  _vapiCalibrateCameraCalculate
struct  _vapiCalibrateCameraExpandersA
struct  _vapiCalibrateCameraExpandersB
struct  _vapiEventList
struct  _vapiGtkGetCoordinates
struct  _vapiTemp1Struct
struct  _vapiWidgetStruct
struct  _vTempFloat

Definições de tipos

typedef _vapiCalibrateCamera vapiCalibrateCamera
typedef _vapiCalibrateCameraCalculate vapiCalibrateCameraCalculate
typedef _vapiCalibrateCameraExpandersA vapiCalibrateCameraExpandersA
typedef _vapiCalibrateCameraExpandersB vapiCalibrateCameraExpandersB
typedef _vapiEventList vapiEventList
typedef _vapiGtkGetCoordinates vapiGtkGetCoordinates
typedef _vapiTemp1Struct vapiTemp1Struct
typedef _vapiWidgetStruct vapiWidgetStruct
typedef _vTempFloat vTempFloat

Funções

int interface_os_linux (vOperationList *OperationList, vGroupList *GroupList, vCameraSettings *CameraSettings, vMacroList *MacroList, vImages *Images, GladeXML *xml)
void showWidget (GtkWidget *widget1, GtkWidget *widget2)
void vapiCompareInt (vImages *Images, vOptions *options, vMacroResult *PreviousResult)
GtkWidget * vapiGtkAboutDialog ()
void vapiGtkCbLoadStaticImage (GtkWidget *widget, vapiTemp1Struct *temp)
void vapiGtkConnectEvents (vapiWidgetStruct *Widgets, vImages *Images, vCameraSettings *CameraSettings, vOperationList *OperationList, vMacroList *MacroList, GladeXML *xml)
void vapiGtkEventCalibrateCamera (GtkWidget *widget, vapiCalibrateCameraCalculate *CalibrateCameraCalculate)
void vapiGtkEventCalibrateCameraTestColourDefinitions (GtkWidget *widget, vapiCalibrateCameraCalculate *CalibrateCameraCalculate)
void vapiGtkExpandersA (GtkWidget *widget, vapiCalibrateCameraExpandersA *expandersA)
void vapiGtkExpandersB (GtkWidget *widget, vapiCalibrateCameraExpandersB *expandersB)
void vapiGtkGetOriginal (GtkWidget *widget, vapiTemp1Struct *temp)
void vapiGtkGrabMouseLocation (GtkWidget *widget, GdkDragContext *drag_context, vapiGtkGetCoordinates *GetCoordinates)
GladeXML * vapiGtkLoadInterface ()
GdkPixbuf * vapiGtkPixbuf (GtkWidget *widget, IplImage *img, int rescale)
void vapiGtkPutImage (GtkWidget *Widget, IplImage *Image)
void vapiGtkPutImageNotScaled (GtkWidget *Widget, IplImage *Image)
void vapiGtkSaveImage (GtkWidget *widget, vImages *Images)
void vapiGtkSaveSelectedRegion (GtkWidget *widget, vapiTemp1Struct *temp)
void vapiGtkSaveTemplate (GtkWidget *widget, vapiTemp1Struct *temp)
void vapiGtkSaveWorkImage (GtkWidget *widget, vapiTemp1Struct *temp)
void vapiGtkSelectRegion (GtkWidget *widget, GdkEventButton *event, vapiGtkGetCoordinates *GetCoordinates)
void vapiGtkSelectROIActual (GtkWidget *widget, GdkEventFocus *event, vapiTemp1Struct *temp)
gboolean vapiGtkShowImageWindow (GtkWidget *widget, GdkEventCrossing *event, vapiTemp1Struct *temp)
gboolean vapiGtkShowImageWindowLeave (GtkWidget *widget, GdkEventCrossing *event, vapiTemp1Struct *temp)
gboolean vapiGtkTemplateDrag (GtkWidget *widget, GdkEventMotion *event, vapiGtkGetCoordinates *GetCoordinates)
void vapiGtkToolbarStyle (GtkWidget *widget, GtkWidget *toolbar)

Variáveis

GtkWidget * LoadScreen
GtkWidget * LoadScreenMessage
GtkWidget * LoadScreenProgress


Documentação dos tipos

typedef struct _vapiCalibrateCamera vapiCalibrateCamera

typedef struct _vapiCalibrateCameraCalculate vapiCalibrateCameraCalculate

typedef struct _vapiCalibrateCameraExpandersA vapiCalibrateCameraExpandersA

typedef struct _vapiCalibrateCameraExpandersB vapiCalibrateCameraExpandersB

typedef struct _vapiEventList vapiEventList

typedef struct _vapiGtkGetCoordinates vapiGtkGetCoordinates

typedef struct _vapiTemp1Struct vapiTemp1Struct

typedef struct _vapiWidgetStruct vapiWidgetStruct

typedef struct _vTempFloat vTempFloat


Documentação das funções

int interface_os_linux ( vOperationList OperationList,
vGroupList GroupList,
vCameraSettings CameraSettings,
vMacroList MacroList,
vImages Images,
GladeXML *  xml 
)

Definido na linha 24 do ficheiro vapiGtkInterface.c.

Referências _vImages::Actual, _vapiGtkWindowSelectGroupStruct::btSelectOperation, _vapiWidgetStruct::cbCam, _vapiWidgetStruct::cbImageFile, _vapiGtkWindowSelectGroupStruct::GroupButtonList, _vapiWidgetStruct::imActual, _vapiWidgetStruct::ImageWindow, _vapiWidgetStruct::ImageWindowSelectRegion, _vapiWidgetStruct::ImageWindowTemplate, _vapiWidgetStruct::imOriginal, _vapiWidgetStruct::imSelectRegion, _vapiWidgetStruct::imSelectTemplate, _vapiWidgetStruct::imShowOriginalSize, _vapiWidgetStruct::imWork, LoadScreen, MacroList, _vapiGtkWindowSelectGroupStruct::nbOptions, OperationList, _vapiGtkWindowSelectGroupStruct::OperationList, _vapiGtkWindowSelectGroupStruct::OperationTreeView, _vapiWidgetStruct::OptionsData, _vapiWidgetStruct::OptionsEvents, _vapiWidgetStruct::OptionsList, _vapiWidgetStruct::OptionsParent, _vImages::Original, _vapiWidgetStruct::rbMenuCasosCamara, _vapiWidgetStruct::rbMenuCasosComprimidos, _vapiWidgetStruct::rbMenuCasosFusiveis, _vapiWidgetStruct::rbMenuCasosOCR, showWidget(), _vapiGtkWindowSelectGroupStruct::stSelectOperation, _vapiWidgetStruct::txtMacroName, _vapiGtkWindowSelectGroupStruct::txtOperation, _vapiWidgetStruct::txtOperation, _vapiGtkWindowSelectGroupStruct::txtOperationDescription, _vapiWidgetStruct::txtOptItemName, _vapiWidgetStruct::txtOptItemNum, vapi_loading_progress(), vapiGtkAboutDialog(), vapiGtkCbMacroStart(), vapiGtkConnectEvents(), vapiGtkErrorDialogInit(), vapiGtkEventsMacrosInit(), vapiGtkImagesThreadsInit(), vapiGtkMacroItemMoveInit(), vapiGtkMacrosTablesInit(), vapiGtkPutImage(), vapiGtkSelectOperationStartWindow(), vapiGtkSetOriginWindowInit(), vapiGtkWindowCalibrateCameraDefines(), vapiGtkWindowIOAddInit(), vapiGtkWindowIOConfigureInit(), _vapiWidgetStruct::winCreateMacro e _vapiGtkWindowSelectGroupStruct::winSelectOperation.

Referenciado por main().

00028 {
00029 
00030         vapiWidgetStruct *Widgets = malloc (sizeof (vapiWidgetStruct));
00031         vapiGtkWindowSelectGroupStruct *GroupStruct =
00032                 malloc (sizeof (vapiGtkWindowSelectGroupStruct));
00033         static char *vapiAuthors;
00034         /*
00035          * Necessário para a tabela de Macros.
00036          */
00037         GtkWidget *MainWindow;
00038         GtkWidget *AboutDialog;
00039         GtkWidget *imCalibrateExample;
00040         GtkWidget *vBoxOperationGroups;
00041         GtkWidget *AboutButton;
00042         GError *error = NULL;
00043 
00044         vapiAuthors = "Luis Matos";
00045 
00046         GroupStruct->OperationList = OperationList;
00047         GroupStruct->GroupButtonList = NULL;
00048 
00049 
00050         /*
00051          * Carregar Widgets necessárias, numa estrutura de ponteiros.
00052          */
00053         vapi_loading_progress ("A Carregar Elementos da Interface");
00054 
00055         Widgets->imActual = glade_xml_get_widget (xml, "imActual");
00056         Widgets->imWork = glade_xml_get_widget (xml, "imWork");
00057         Widgets->imOriginal = glade_xml_get_widget (xml, "imOriginal");
00058 
00059         Widgets->cbCam = glade_xml_get_widget (xml, "cbCam");
00060 
00061         Widgets->txtMacroName = glade_xml_get_widget (xml, "txtMacroName");
00062 
00063         Widgets->txtOptItemName =
00064                 glade_xml_get_widget (xml, "txtOptItemName");
00065         Widgets->txtOptItemNum = glade_xml_get_widget (xml, "txtOptItemNum");
00066         Widgets->OptionsParent = glade_xml_get_widget (xml, "vbox6");
00067         Widgets->cbImageFile = glade_xml_get_widget (xml, "cbImageFile");
00068         Widgets->rbMenuCasosCamara = glade_xml_get_widget (xml, "rbCamara");
00069         Widgets->rbMenuCasosFusiveis =
00070                 glade_xml_get_widget (xml, "rbFusiveis");
00071         Widgets->rbMenuCasosComprimidos =
00072                 glade_xml_get_widget (xml, "rbComprimidos");
00073         Widgets->rbMenuCasosOCR = glade_xml_get_widget (xml, "rbOCR");
00074 
00075         Widgets->ImageWindowTemplate =
00076                 glade_xml_get_widget (xml, "ImageWindowTemplate");
00077         Widgets->imSelectTemplate =
00078                 glade_xml_get_widget (xml, "imSelectTemplate");
00079         Widgets->ImageWindow = glade_xml_get_widget (xml, "ImageWindow");
00080         Widgets->imShowOriginalSize =
00081                 glade_xml_get_widget (xml, "imShowOriginalSize");
00082         Widgets->ImageWindowSelectRegion =
00083                 glade_xml_get_widget (xml, "ImageWindowSelectRegion");
00084         Widgets->imSelectRegion =
00085                 glade_xml_get_widget (xml, "imSelectRegion");
00086         Widgets->txtOperation = glade_xml_get_widget (xml, "txtOperation");
00087         MainWindow = glade_xml_get_widget (xml, "main_window");
00088         imCalibrateExample = glade_xml_get_widget (xml, "imCalibrateExample");
00089         vBoxOperationGroups =
00090                 glade_xml_get_widget (xml, "vBoxOperationGroups");
00091         GroupStruct->OperationTreeView =
00092                 glade_xml_get_widget (xml, "tvSelectOperation");
00093 
00094         GroupStruct->txtOperationDescription =
00095                 glade_xml_get_widget (xml, "txtOperationDescription");
00096         GroupStruct->stSelectOperation = (GtkStatusbar *)
00097                 glade_xml_get_widget (xml, "stSelectOperation");
00098         GroupStruct->nbOptions = glade_xml_get_widget (xml, "nbOptions");
00099         GroupStruct->txtOperation = Widgets->txtOperation;
00100         GroupStruct->winSelectOperation =
00101                 glade_xml_get_widget (xml, "winSelectOperation");
00102         GroupStruct->btSelectOperation =
00103                 glade_xml_get_widget (xml, "btSelectOperation");
00104         AboutButton = glade_xml_get_widget (xml, "sobre1");
00105         Widgets->winCreateMacro =
00106                 glade_xml_get_widget (xml, "winCreateMacro");
00107 
00108         /*
00109          * Iniciar a tabela de Macros.
00110          */
00111 
00112         vapi_loading_progress ("A Configurar Elementos");
00113         vapiGtkErrorDialogInit (xml);
00114         /*
00115          * Fim da tabela.
00116          */
00117 
00118         /*
00119          * Criar a Janela About.
00120          */
00121         vapi_loading_progress
00122                 ("A Criar a Janela Com informção sobre o Vapi");
00123         AboutDialog = vapiGtkAboutDialog ();
00124 
00125         g_signal_connect (G_OBJECT (AboutButton), "activate",
00126                           G_CALLBACK (showWidget), AboutDialog);
00127 
00128         g_signal_connect (G_OBJECT (AboutDialog), "delete-event",
00129                           G_CALLBACK (gtk_widget_hide_on_delete),
00130                           AboutDialog);
00131 
00132 
00133 
00134         /*
00135          * Icon de câmara para a barra de ferramentas.
00136          */
00137 
00138         gtk_tool_button_set_stock_id ((GtkToolButton *) Widgets->cbCam, NULL);
00139         gtk_tool_button_set_icon_widget ((GtkToolButton *) Widgets->cbCam,
00140                                          gtk_image_new_from_file
00141                                          ("./pixmaps/camera-video.png"));
00142         gtk_image_set_from_file ((GtkImage *) imCalibrateExample,
00143                                  "pixmaps/exemplo_calibrate.png");
00144 
00145         gtk_widget_show (gtk_tool_button_get_icon_widget
00146                          ((GtkToolButton *) Widgets->cbCam));
00147 
00148         vapiGtkWindowCalibrateCameraDefines (xml);
00149 
00150         /*
00151          * Iniciar suporte a threads;
00152          */
00153         if (!g_thread_supported ())
00154         {
00155                 g_thread_init (NULL);
00156         }
00157         vapiGtkImagesThreadsInit (Widgets->imOriginal, Widgets->imActual,
00158                                   Widgets->imWork, Images);
00159 
00160 #ifdef VAPI_OS_LINUX
00161 
00162         gdk_threads_init ();
00163 #endif
00164 
00165         vapiGtkConnectEvents (Widgets, Images, CameraSettings,
00166                               OperationList, MacroList, xml);
00167         /*
00168          * Definir as janelas de IO's
00169          */
00170         vapiGtkWindowIOAddInit (xml);
00171 
00172         vapiGtkWindowIOConfigureInit (xml);
00173         Widgets->OptionsList = NULL;
00174         Widgets->OptionsData = NULL;
00175         Widgets->OptionsEvents = NULL;
00176         vapiGtkEventsMacrosInit (xml, MacroList, OperationList, Images,
00177                                  &Widgets->OptionsData);
00178         vapiGtkMacrosTablesInit (xml, MacroList, &Widgets->OptionsList,
00179                                  &Widgets->OptionsData,
00180                                  &Widgets->OptionsEvents, Images);
00181         vapiGtkCbMacroStart (); /* iniciar a caixa de selecção de Macros */
00182         vapiGtkMacroItemMoveInit (xml, MacroList);
00183         /*
00184          * Mostrar a Janela.
00185          */
00186         vapi_loading_progress ("A Criar a interface Principal");
00187         gtk_window_set_icon_from_file ((GtkWindow *) MainWindow,
00188                                        "pixmaps/logo.svg", &error);
00189         gtk_widget_show_all (MainWindow);
00190         gtk_widget_grab_focus (LoadScreen);
00191         vapi_loading_progress ("A Agrupar as Operações");
00192 
00193 
00194         vapiGtkSelectOperationStartWindow (GroupList, GroupStruct,
00195                                            vBoxOperationGroups);
00196         /*
00197          * Mostrar as imagens de trabalho.
00198          */
00199         vapi_loading_progress ("A Carregar as Imagens na interface");
00200 
00201         vapiGtkPutImage (Widgets->imOriginal, Images->Original);
00202         vapiGtkPutImage (Widgets->imWork, Images->Actual);
00203         vapiGtkPutImage (Widgets->imActual, Images->Actual);
00204 
00205         /*
00206          * Mostrar e definir a janela de Selecção da Origem da imagem.
00207          */
00208         vapi_loading_progress
00209                 ("A questionar a Existência de Pré-configuração");
00210         vapiGtkSetOriginWindowInit (xml, CameraSettings, Images);
00211 
00212         vapi_loading_progress ("Aplicação Iniciada.");
00213 
00214         /*
00215          * Iniciar o Loop
00216          */
00217         gtk_main ();
00218 
00219 
00220         return 0;
00221 
00222 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void showWidget ( GtkWidget *  widget1,
GtkWidget *  widget2 
)

Definido na linha 593 do ficheiro vapiGtkEvents.c.

Referenciado por interface_os_linux().

00594 {
00595         gtk_widget_show_all (widget2);
00596 }

Here is the caller graph for this function:

void vapiCompareInt ( vImages Images,
vOptions options,
vMacroResult PreviousResult 
)

Definido na linha 605 do ficheiro vapiOperationsDefault.c.

Referenciado por vapiAvailableEfects().

00607 {
00608         int result, testValue;
00609         if (PreviousResult->intsNumber == 0)
00610         {
00611                 return;
00612         }
00613         result = vapiResultGetInt (PreviousResult,
00614                                    vapiOptionsGetInts (options, 0));
00615 
00616         testValue = vapiOptionsGetInts (options, 1);
00617         switch (vapiOptionsGetChoices (options, 0))
00618         {
00619         case 0:
00620         {
00621                 if (result > testValue)
00622                 {
00623                         PreviousResult->Decision = vTRUE;
00624                 }
00625                 else
00626                 {
00627                         PreviousResult->Decision = vFALSE;
00628                 }
00629                 break;
00630         }
00631         case 1:
00632         {
00633                 if (result >= testValue)
00634                 {
00635                         PreviousResult->Decision = vTRUE;
00636                 }
00637                 else
00638                 {
00639                         PreviousResult->Decision = vFALSE;
00640                 }
00641                 break;
00642         }
00643         case 2:
00644         {
00645                 if (result == testValue)
00646                 {
00647                         PreviousResult->Decision = vTRUE;
00648                 }
00649                 else
00650                 {
00651                         PreviousResult->Decision = vFALSE;
00652                 }
00653                 break;
00654         }
00655         case 3:
00656         {
00657                 if (result <= testValue)
00658                 {
00659                         PreviousResult->Decision = vTRUE;
00660                 }
00661                 else
00662                 {
00663                         PreviousResult->Decision = vFALSE;
00664                 }
00665                 break;
00666         }
00667         case 4:
00668         {
00669                 if (result < testValue)
00670                 {
00671                         PreviousResult->Decision = vTRUE;
00672                 }
00673                 else
00674                 {
00675                         PreviousResult->Decision = vFALSE;
00676                 }
00677                 break;
00678         }
00679         case 5:
00680         {
00681                 if (result != testValue)
00682                 {
00683                         PreviousResult->Decision = vTRUE;
00684                 }
00685                 else
00686                 {
00687                         PreviousResult->Decision = vFALSE;
00688                 }
00689                 break;
00690         }
00691         }
00692 }

Here is the caller graph for this function:

GtkWidget* vapiGtkAboutDialog (  ) 

Definido na linha 260 do ficheiro vapiGtkInterface.c.

Referências VAPI_VERSION.

Referenciado por interface_os_linux().

00261 {
00262         GtkWidget *AboutDialog;
00263         GdkPixbuf *pixbuf;
00264         GError *error = NULL;
00265         const gchar *Authors[] = { "Luis Matos <a26652@alunos.mec.ua.pt>",
00266                 "Orientado por:",
00267                 "Eng. Abílio Borges <aborges@atena-ai.pt>",
00268                 "Eng. Vítor Santos <vsantos@mec.ua.pt>", NULL
00269         };
00270 
00271         AboutDialog = gtk_about_dialog_new ();
00272         gtk_window_set_position ((GtkWindow *) AboutDialog,
00273                                  GTK_WIN_POS_CENTER_ALWAYS);
00274         gtk_about_dialog_set_name ((GtkAboutDialog *) AboutDialog, "Vapi");
00275         gtk_about_dialog_set_authors ((GtkAboutDialog *) AboutDialog,
00276                                       Authors);
00277         gtk_about_dialog_set_comments ((GtkAboutDialog *) AboutDialog,
00278                                        "Visão Artificial Para a Indústria");
00279         gtk_about_dialog_set_copyright ((GtkAboutDialog *)
00280                                         AboutDialog,
00281                                         "ATENA - Automação Industrial \n e \n Departamento de Engenharia Mecânica \n da Universidade de Aveiro");
00282         gtk_about_dialog_set_version ((GtkAboutDialog *) AboutDialog,
00283                                       VAPI_VERSION);
00284         gtk_about_dialog_set_website ((GtkAboutDialog *) AboutDialog,
00285                                       "www.mec.ua.pt");
00286         pixbuf = gdk_pixbuf_new_from_file ("./pixmaps/logo.png", &error);
00287 
00288         gtk_about_dialog_set_logo ((GtkAboutDialog *) AboutDialog, pixbuf);
00289         return AboutDialog;
00290 }

Here is the caller graph for this function:

void vapiGtkCbLoadStaticImage ( GtkWidget *  widget,
vapiTemp1Struct temp 
)

Definido na linha 57 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vapiTemp1Struct::CameraSettings, _vapiWidgetStruct::imActual, _vapiTemp1Struct::Images, _vapiWidgetStruct::imOriginal, _vapiWidgetStruct::imWork, _vImages::Original, vapiGetSnapshot(), vapiGtkPutImage(), vapiOriginal2Actual(), vImagesFreeImages() e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00058 {
00059         vImagesFreeImages (temp->Images);
00060 
00061         vapiGetSnapshot (temp->Images, temp->CameraSettings);
00062         vapiOriginal2Actual (temp->Images);
00063         vapiGtkPutImage (temp->Widgets->imOriginal, temp->Images->Original);
00064         vapiGtkPutImage (temp->Widgets->imActual, temp->Images->Actual);
00065         vapiGtkPutImage (temp->Widgets->imWork, temp->Images->Actual);
00066 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkConnectEvents ( vapiWidgetStruct Widgets,
vImages Images,
vCameraSettings CameraSettings,
vOperationList OperationList,
vMacroList MacroList,
GladeXML *  xml 
)

vapiGtkConnectEvents é a função de Gestão de Eventos. Carrega as widgets necessárias numa estrutura de ponteiros e distribui-as pelas funções pelas funções que se encarregam dos eventos.

Definido na linha 19 do ficheiro vapiGtkConnectEvents.c.

Referências _vapiCalibrateCameraCalculate::CameraSettings, _vapiTemp1Struct::CameraSettings, _vapiWidgetStruct::cbCam, _vapiTemp1Struct::GetCoordinates, _vapiTemp1Struct::Images, _vapiCalibrateCameraCalculate::Images, _vapiCalibrateCamera::Images, _vapiGtkGetCoordinates::Images, _vapiCalibrateCamera::ImCalibrateOriginal, _vapiWidgetStruct::imSelectRegion, _vapiGtkGetCoordinates::imSelectRegion, _vapiWidgetStruct::imSelectTemplate, _vapiGtkGetCoordinates::imSelectTemplate, _vapiTemp1Struct::imWork, MacroList, _vapiTemp1Struct::MacroList, _vapiTemp1Struct::OperationList, OperationList, _vapiCalibrateCameraCalculate::OperationList, _vapiWidgetStruct::OptionsData, _vapiWidgetStruct::OptionsFrame, _vapiWidgetStruct::OptionsList, SelectedMacro, SelectedMacroGlobal, _vapiGtkGetCoordinates::stSelectRegion, _vapiGtkGetCoordinates::stTemplateWindow, _vRefreshImage::Temp, _vapiWidgetStruct::txtOperation, _vapiGtkGetCoordinates::txtTemplateFilename, vapi_loading_progress(), vapiCamStop(), vapiGtkCbLoadStaticImage(), vapiGtkEventCalibrateCamera(), vapiGtkEventCalibrateCameraTestColourDefinitions(), vapiGtkGetOriginal(), vapiGtkGrabMouseLocation(), vapiGtkMacroAppendItem(), vapiGtkMacroApply(), vapiGtkMacroDeleteItem(), vapiGtkMacroInsertItem(), vapiGtkMacroLauchDeleteDialog(), vapiGtkMacroUpdateItemOptions(), vapiGtkOperationApply(), vapiGtkOperationShowOptions(), vapiGtkSaveImage(), vapiGtkSaveSelectedRegion(), vapiGtkSaveTemplate(), vapiGtkSaveWorkImage(), vapiGtkSelectRegion(), vapiGtkSelectROIActual(), vapiGtkTemplateDrag(), vapiGtkToolbarStyle(), vapiGtkWindowCalibrateCameraInitEvents(), vapiGtkWindowOnFocusCalibrateCamera(), vapiRefreshImageThread(), _vapiGtkGetCoordinates::Vertice, _vapiTemp1Struct::Widgets e _vapiCalibrateCameraCalculate::xml.

Referenciado por interface_os_linux().

00023 {
00024         vapiTemp1Struct *temp1 = malloc (sizeof (vapiTemp1Struct));
00025         vRefreshImage *RefreshImage = malloc (sizeof (vRefreshImage));
00026         vapiCalibrateCamera *calibrateCamera =
00027                 malloc (sizeof (vapiCalibrateCamera));
00028         vapiCalibrateCameraCalculate *CalibrateCameraCalculate =
00029                 malloc (sizeof (vapiCalibrateCameraCalculate));
00030         vapiGtkGetCoordinates *GetCoordinates;
00031 
00032         GtkWidget *btApply;
00033         GtkWidget *btApplyMacro;
00034         GtkWidget *btOriginalImage;
00035         GtkWidget *btMatch;
00036         GtkWidget *btSaveImage;
00037         GtkWidget *btMacroDelete;
00038         GtkWidget *btMacroItemChange;
00039         GtkWidget *btAddMacroItem;
00040         GtkWidget *btAddMacroItemHere;
00041         GtkWidget *btDeleteMacroItem;
00042         GtkWidget *btMoveMacroItem;
00043         GtkWidget *btRefresh;
00044         GtkWidget *btSaveWorkImage;
00045         GtkWidget *toolbar;
00046         GtkWidget *cbMenuToolbarNames;
00047         GtkWidget *menuRefresh;
00048         GtkWidget *menuOriginal;
00049         GtkWidget *ebImWork;
00050         GtkWidget *ebImOriginal;
00051         GtkWidget *ebImActual;
00052         GtkWidget *ebSelectTemplate;
00053         GtkWidget *ebSelectRegion;
00054         GtkWidget *btSaveTemplate;
00055         GtkWidget *btSelectRegion;
00056         GtkWidget *winCalibrateCamera;
00057         GtkWidget *btCalibrateCamera;
00058         GtkWidget *btCalibrateTestDefinitions;
00059         GtkWidget *rbMenuCasosPatternMatchOk;
00060         GtkWidget *rbMenuCasosPatternMatchNOk1;
00061         GtkWidget *rbMenuCasosPatternMatchNOk2;
00062         GtkWidget *rbMenuCasosPatternSearchNOk;
00063         GtkWidget *rbMenuCasosPatternSearchOk;
00064         GtkWidget *btSaveOrigin;
00065 
00066         vapi_loading_progress ("A definir estruturas Auxiliares");
00067 
00068         GetCoordinates = malloc (sizeof (vapiGtkGetCoordinates));
00069 
00070         GetCoordinates->Vertice[0].x = -1;
00071         GetCoordinates->Vertice[0].y = -1;
00072         GetCoordinates->Vertice[1].x = -1;
00073         GetCoordinates->Vertice[1].y = -1;
00074         GetCoordinates->Images = Images;
00075         GetCoordinates->imSelectTemplate = Widgets->imSelectTemplate;
00076         GetCoordinates->imSelectRegion = Widgets->imSelectRegion;
00077         temp1->CameraSettings = CameraSettings;
00078 
00079         calibrateCamera->Images = Images;
00080         CalibrateCameraCalculate->CameraSettings = CameraSettings;
00081 
00082         CalibrateCameraCalculate->xml = xml;
00083         CalibrateCameraCalculate->OperationList = OperationList;
00084         CalibrateCameraCalculate->Images = Images;
00085 
00086 
00087         temp1->Widgets = Widgets;
00088         temp1->Images = Images;
00089         temp1->OperationList = OperationList;
00090         
00091         SelectedMacro = -1;
00092         SelectedMacroGlobal = -1;
00093         
00094         temp1->GetCoordinates = GetCoordinates;
00095         temp1->MacroList = MacroList;
00096         /*
00097          * Iniciar as ipções
00098          */
00099         temp1->Widgets->OptionsFrame = 0;
00100         temp1->Widgets->OptionsList = NULL;
00101         temp1->Widgets->OptionsData = NULL;
00102 
00103         RefreshImage->Temp = temp1;
00104         /*
00105          * Evento de início.
00106          */
00107         temp1->imWork = NULL;
00108         /*
00109          * Algumas widgets apenas são necessárias para ter eventos relacionados e não são utilizadas em mais lado nenhum.
00110          */
00111 
00112         ebImWork = glade_xml_get_widget (xml, "ebImWork");
00113         ebImOriginal = glade_xml_get_widget (xml, "ebOriginal");
00114         ebImActual = glade_xml_get_widget (xml, "ebImActual");
00115         ebSelectTemplate = glade_xml_get_widget (xml, "ebSelectTemplate");
00116         ebSelectRegion = glade_xml_get_widget (xml, "ebSelectRegion");
00117         GetCoordinates->stTemplateWindow =
00118                 glade_xml_get_widget (xml, "stTemplateWindow");
00119         GetCoordinates->stSelectRegion =
00120                 glade_xml_get_widget (xml, "stSelectRegion");
00121         GetCoordinates->txtTemplateFilename =
00122                 glade_xml_get_widget (xml, "txtTemplateFilename");
00123         btSaveTemplate = glade_xml_get_widget (xml, "btSaveTemplate");
00124         btSelectRegion = glade_xml_get_widget (xml, "btSelectRegion");
00125         btApply = glade_xml_get_widget (xml, "Apply");
00126         btApplyMacro = glade_xml_get_widget (xml, "btApplyMacro");
00127         btMatch = glade_xml_get_widget (xml, "btMatch");
00128         btSaveImage = glade_xml_get_widget (xml, "btSaveImage");
00129         btMacroDelete = glade_xml_get_widget (xml, "btMacroDelete");
00130         btMacroItemChange = glade_xml_get_widget (xml, "btMacroItemChange");
00131         btOriginalImage = glade_xml_get_widget (xml, "btOriginalImage");
00132         btAddMacroItem = glade_xml_get_widget (xml, "btAddMacroItem");
00133         btAddMacroItemHere = glade_xml_get_widget (xml, "btAddMacroItemHere");
00134         btDeleteMacroItem = glade_xml_get_widget (xml, "btDeleteMacroItem");
00135         btMoveMacroItem = glade_xml_get_widget (xml, "btMoveMacroItem");
00136         btRefresh = glade_xml_get_widget (xml, "btRefresh");
00137         btSaveWorkImage = glade_xml_get_widget (xml, "btSaveWorkImage");
00138         menuRefresh = glade_xml_get_widget (xml, "menuRefresh");
00139         menuOriginal = glade_xml_get_widget (xml, "menuOriginal");
00140         toolbar = glade_xml_get_widget (xml, "toolbar");
00141         cbMenuToolbarNames = glade_xml_get_widget (xml, "cbMenuToolbarNames");
00142         winCalibrateCamera = glade_xml_get_widget (xml, "winCalibrateCamera");
00143         calibrateCamera->ImCalibrateOriginal =
00144                 glade_xml_get_widget (xml, "imCalibrateOriginal");
00145         btCalibrateCamera = glade_xml_get_widget (xml, "btCalibrateCamera");
00146         btCalibrateTestDefinitions =
00147                 glade_xml_get_widget (xml, "btCalibrateTestDefinitions");
00148         rbMenuCasosPatternMatchOk =
00149                 glade_xml_get_widget (xml, "rbMenuCasosPatternMatchOk");
00150         rbMenuCasosPatternMatchNOk1 =
00151                 glade_xml_get_widget (xml, "rbMenuCasosPatternMatchNOk1");
00152         rbMenuCasosPatternMatchNOk2 =
00153                 glade_xml_get_widget (xml, "rbMenuCasosPatternMatchNOk2");
00154         rbMenuCasosPatternSearchOk =
00155                 glade_xml_get_widget (xml, "rbMenuCasosPatternSearchOk");
00156         rbMenuCasosPatternSearchNOk =
00157                 glade_xml_get_widget (xml, "rbMenuCasosPatternSearchNOk");
00158         btSaveOrigin = glade_xml_get_widget (xml, "btSaveOrigin");
00159 
00160         /*
00161          * Eventos à espera de sinal.
00162          */
00163 
00164         vapi_loading_progress ("A definir Eventos da interface");
00165 
00166         /*
00167          * Eventos Relaativos à Janela para calibrar Camara.
00168          */
00169         vapiGtkWindowCalibrateCameraInitEvents (xml);
00170 
00171         /*
00172          * Restantes Eventos.
00173          */
00174         g_signal_connect (G_OBJECT (btApply), "clicked",
00175                           G_CALLBACK (vapiGtkOperationApply), temp1);
00176 
00177         g_signal_connect (G_OBJECT (btApplyMacro), "clicked",
00178                           G_CALLBACK (vapiGtkMacroApply), temp1);
00179 
00180         g_signal_connect (G_OBJECT (Widgets->cbCam), "clicked",
00181                           G_CALLBACK (vapiRefreshImageThread), RefreshImage);
00182 
00183         g_signal_connect (G_OBJECT (Widgets->cbCam),
00184                           "clicked", G_CALLBACK (vapiCamStop), RefreshImage);
00185 
00186         g_signal_connect (G_OBJECT (Widgets->txtOperation), "changed",
00187                           G_CALLBACK (vapiGtkOperationShowOptions), temp1);
00188 
00189         g_signal_connect (G_OBJECT (btSaveImage), "clicked",
00190                           G_CALLBACK (vapiGtkSaveImage), temp1->Images);
00191 
00192         g_signal_connect (G_OBJECT (btAddMacroItem), "clicked",
00193                           G_CALLBACK (vapiGtkMacroAppendItem), temp1);
00194 
00195         g_signal_connect (G_OBJECT (btAddMacroItemHere), "clicked",
00196                           G_CALLBACK (vapiGtkMacroInsertItem), temp1);
00197 
00198         g_signal_connect (G_OBJECT (btDeleteMacroItem), "clicked",
00199                           G_CALLBACK (vapiGtkMacroDeleteItem), temp1);
00200 
00201         
00202 
00203         g_signal_connect (G_OBJECT (btMacroItemChange), "clicked",
00204                           G_CALLBACK (vapiGtkMacroUpdateItemOptions), temp1);
00205 
00206         g_signal_connect (G_OBJECT (btMacroDelete), "clicked",
00207                           G_CALLBACK (vapiGtkMacroLauchDeleteDialog), NULL);
00208 
00209         
00210 
00211         g_signal_connect (G_OBJECT (btRefresh), "clicked",
00212                           G_CALLBACK (vapiGtkCbLoadStaticImage), temp1);
00213 
00214         g_signal_connect (G_OBJECT (menuRefresh), "activate",
00215                           G_CALLBACK (vapiGtkCbLoadStaticImage), temp1);
00216 
00217         g_signal_connect (G_OBJECT (btOriginalImage), "clicked",
00218                           G_CALLBACK (vapiGtkGetOriginal), temp1);
00219 
00220         g_signal_connect (G_OBJECT (menuOriginal), "activate",
00221                           G_CALLBACK (vapiGtkGetOriginal), temp1);
00222 
00223         g_signal_connect (G_OBJECT (cbMenuToolbarNames), "activate",
00224                           G_CALLBACK (vapiGtkToolbarStyle), toolbar);
00225 
00226         g_signal_connect (G_OBJECT (btSaveWorkImage), "clicked",
00227                           G_CALLBACK (vapiGtkSaveWorkImage), temp1);
00228 
00229         g_signal_connect (G_OBJECT (ebImWork), "button-press-event",
00230                           G_CALLBACK (vapiGtkSelectROIActual), temp1);
00231 
00232         g_signal_connect (G_OBJECT (ebImActual), "button-press-event",
00233                           G_CALLBACK (vapiGtkSelectROIActual), temp1);
00234 
00235         g_signal_connect (G_OBJECT (ebSelectRegion), "button-press-event",
00236                           G_CALLBACK (vapiGtkSelectRegion), GetCoordinates);
00237 
00238 
00239         g_signal_connect (G_OBJECT (ebSelectTemplate), "button-press-event",
00240                           G_CALLBACK (vapiGtkGrabMouseLocation),
00241                           GetCoordinates);
00242         g_signal_connect (G_OBJECT (ebSelectTemplate), "motion-notify-event",
00243                           G_CALLBACK (vapiGtkTemplateDrag), GetCoordinates);
00244         g_signal_connect (G_OBJECT (btSaveTemplate), "clicked",
00245                           G_CALLBACK (vapiGtkSaveTemplate), temp1);
00246         g_signal_connect (G_OBJECT (btSelectRegion), "clicked",
00247                           G_CALLBACK (vapiGtkSaveSelectedRegion), temp1);
00248         g_signal_connect (G_OBJECT (winCalibrateCamera), "show",
00249                           G_CALLBACK (vapiGtkWindowOnFocusCalibrateCamera),
00250                           calibrateCamera);
00251         g_signal_connect (G_OBJECT (btCalibrateCamera), "clicked",
00252                           G_CALLBACK (vapiGtkEventCalibrateCamera),
00253                           CalibrateCameraCalculate);
00254         g_signal_connect (G_OBJECT (btCalibrateTestDefinitions), "clicked",
00255                           G_CALLBACK
00256                           (vapiGtkEventCalibrateCameraTestColourDefinitions),
00257                           CalibrateCameraCalculate);
00258         /*
00259          * Evento de actualizar as imagens principais sempre que se si da janela.
00260          */
00261         g_signal_connect_after (G_OBJECT (btSaveOrigin), "clicked",
00262                           G_CALLBACK (vapiGtkCbLoadStaticImage), temp1);
00263 
00264 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkEventCalibrateCamera ( GtkWidget *  widget,
vapiCalibrateCameraCalculate CalibrateCameraCalculate 
)

Definido na linha 573 do ficheiro vapiGtkEvents.c.

Referências vapiGtkWindowCalibrateCameraGetImages() e vTRUE.

Referenciado por vapiGtkConnectEvents().

00576 {
00577 
00578         vapiGtkWindowCalibrateCameraGetImages (CalibrateCameraCalculate,
00579                                                vTRUE);
00580 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkEventCalibrateCameraTestColourDefinitions ( GtkWidget *  widget,
vapiCalibrateCameraCalculate CalibrateCameraCalculate 
)

Definido na linha 583 do ficheiro vapiGtkEvents.c.

Referências vapiGtkWindowCalibrateCameraGetImages() e vFALSE.

Referenciado por vapiGtkConnectEvents().

00586 {
00587 
00588         vapiGtkWindowCalibrateCameraGetImages (CalibrateCameraCalculate,
00589                                                vFALSE);
00590 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkExpandersA ( GtkWidget *  widget,
vapiCalibrateCameraExpandersA expandersA 
)

Definido na linha 524 do ficheiro vapiGtkEvents.c.

Referências _vapiCalibrateCameraExpandersA::exCalibrateAColour, _vapiCalibrateCameraExpandersA::exCalibrateADistance e _vapiCalibrateCameraExpandersA::exCalibrateAFilters.

Referenciado por vapiGtkWindowCalibrateCameraInitEvents().

00526 {
00527         if (widget != expandersA->exCalibrateAColour)
00528         {
00529                 gtk_expander_set_expanded ((GtkExpander *) expandersA->
00530                                            exCalibrateAColour, FALSE);
00531 
00532         }
00533         if (widget != expandersA->exCalibrateAFilters)
00534         {
00535                 gtk_expander_set_expanded ((GtkExpander *) expandersA->
00536                                            exCalibrateAFilters, FALSE);
00537 
00538         }
00539         if (widget != expandersA->exCalibrateADistance)
00540         {
00541                 gtk_expander_set_expanded ((GtkExpander *) expandersA->
00542                                            exCalibrateADistance, FALSE);
00543 
00544         }
00545 
00546 }

Here is the caller graph for this function:

void vapiGtkExpandersB ( GtkWidget *  widget,
vapiCalibrateCameraExpandersB expandersB 
)

Definido na linha 548 do ficheiro vapiGtkEvents.c.

Referências _vapiCalibrateCameraExpandersB::exCalibrateBColour, _vapiCalibrateCameraExpandersB::exCalibrateBDistance e _vapiCalibrateCameraExpandersB::exCalibrateBFilters.

Referenciado por vapiGtkWindowCalibrateCameraInitEvents().

00550 {
00551         if (widget != expandersB->exCalibrateBColour)
00552         {
00553                 gtk_expander_set_expanded ((GtkExpander *) expandersB->
00554                                            exCalibrateBColour, FALSE);
00555 
00556         }
00557         if (widget != expandersB->exCalibrateBFilters)
00558         {
00559                 gtk_expander_set_expanded ((GtkExpander *) expandersB->
00560                                            exCalibrateBFilters, FALSE);
00561 
00562         }
00563         if (widget != expandersB->exCalibrateBDistance)
00564         {
00565                 gtk_expander_set_expanded ((GtkExpander *) expandersB->
00566                                            exCalibrateBDistance, FALSE);
00567 
00568         }
00569 
00570 }

Here is the caller graph for this function:

void vapiGtkGetOriginal ( GtkWidget *  widget,
vapiTemp1Struct temp 
)

Definido na linha 69 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vapiWidgetStruct::imActual, _vapiTemp1Struct::Images, _vapiWidgetStruct::imWork, vapiGtkPutImage(), vapiOriginal2Actual(), vImagesFreeActual() e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00070 {
00071         vImagesFreeActual (temp->Images);
00072         vapiOriginal2Actual (temp->Images);
00073         vapiGtkPutImage (temp->Widgets->imActual, temp->Images->Actual);
00074         vapiGtkPutImage (temp->Widgets->imWork, temp->Images->Actual);
00075 
00076 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkGrabMouseLocation ( GtkWidget *  widget,
GdkDragContext *  drag_context,
vapiGtkGetCoordinates GetCoordinates 
)

Definido na linha 181 do ficheiro vapiGtkEvents.c.

Referências v_debug e _vapiGtkGetCoordinates::Vertice.

Referenciado por vapiGtkConnectEvents().

00184 {
00185         gtk_widget_get_pointer (widget,
00186                                 &GetCoordinates->Vertice[0].x,
00187                                 &GetCoordinates->Vertice[0].y);
00188         v_debug ("Coordendas do rato, %d %d",
00189                  GetCoordinates->Vertice[0].x, GetCoordinates->Vertice[0].y);
00190         gtk_statusbar_push ((GtkStatusbar *) GetCoordinates->
00191                             stTemplateWindow, 0,
00192                             g_strdup_printf
00193                             ("Vertice[0]: (%d,%d)",
00194                              GetCoordinates->
00195                              Vertice[0].x, GetCoordinates->Vertice[0].y));
00196 }

Here is the caller graph for this function:

GladeXML* vapiGtkLoadInterface (  ) 

Função vapiLoadGtkMainWindow() Carrega o interface gtk e retorna o ponteiro para o objecto GladeXML que representa o ponteiro para o ficheiro xml.

Definido na linha 230 do ficheiro vapiGtkInterface.c.

Referências vapiGtkMessagesInit().

Referenciado por main().

00231 {
00232 
00233         GladeXML *xml;
00234 
00235         gtk_init (NULL, NULL);
00236 
00237         /*
00238          * Carregar o interface.
00239          */
00240 
00241         xml = glade_xml_new ("./src/interface/interface_gtk.glade",
00242                              NULL, NULL);
00243         /*
00244          * É necessário que estejam disponíveis deste o inicio.
00245          */
00246         vapiGtkMessagesInit (xml);
00247 
00248 
00249 
00250         /*
00251          * Ligar aos Sinais.
00252          */
00253         glade_xml_signal_autoconnect (xml);
00254 
00255         return xml;
00256 
00257 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

GdkPixbuf* vapiGtkPixbuf ( GtkWidget *  widget,
IplImage *  img,
int  rescale 
)

Função que cria o buffer de imagem para mostrar no widget, verificando as condições:

Definido na linha 16 do ficheiro vapiGtkImageAux.c.

Referências v_error() e vapiImagesSameSize().

Referenciado por vapiGtkPutImage() e vapiGtkPutImageNotScaled().

00017 {
00018 
00019         GdkPixbuf *tempPixbuf;
00020         IplImage *tempImg;
00021 
00022         switch (img->nChannels)
00023         {
00024 
00025         case 1:
00026                 tempImg = vapiImagesSameSize (img, 3);
00027                 cvMerge (img, img, img, NULL, tempImg);
00028                 break;
00029 
00030         case 3:
00031                 tempImg = vapiImagesSameSize (img, 3);
00032                 cvConvertImage (img, tempImg, CV_CVTIMG_SWAP_RB);
00033                 break;
00034 
00035         default:
00036                 v_error (" Erro, numero invalido de canais: %d .",
00037                         img->nChannels);
00038                 return 0;
00039                 break;
00040         }
00041 
00042         tempPixbuf = gdk_pixbuf_new_from_data ((uchar *) tempImg->imageData,
00043                                                GDK_COLORSPACE_RGB,
00044                                                0,
00045                                                8,
00046                                                tempImg->width,
00047                                                tempImg->height,
00048                                                tempImg->widthStep,
00049                                                NULL, NULL);
00050 
00051         if (rescale > 0)
00052         {
00053                 tempPixbuf = gdk_pixbuf_scale_simple (tempPixbuf,
00054                                                       widget->allocation.
00055                                                       width,
00056                                                       widget->allocation.
00057                                                       height,
00058                                                       GDK_INTERP_BILINEAR);
00059         }
00060         else
00061         {
00062                 tempPixbuf = gdk_pixbuf_scale_simple (tempPixbuf,
00063                                                       img->width,
00064                                                       img->height,
00065                                                       GDK_INTERP_BILINEAR);
00066         }
00067 
00068         cvReleaseImage (&tempImg);
00069         return tempPixbuf;
00070 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkPutImage ( GtkWidget *  Widget,
IplImage *  Image 
)

carrega a imagem para o widget dado.

Definido na linha 77 do ficheiro vapiGtkImageAux.c.

Referências vapiGtkPixbuf().

Referenciado por interface_os_linux(), vapiGtkCbLoadStaticImage(), vapiGtkGetOriginal(), vapiGtkImagesFastUpdateIdle(), vapiGtkImagesUpdateIdle(), vapiGtkOperationApply(), vapiGtkSaveWorkImage(), vapiGtkSetOriginWindowTestSaveOrigin(), vapiGtkTemplateDrag(), vapiGtkWindowCalibrateCameraGetImages(), vapiGtkWindowOnFocusCalibrateCamera() e vapiRefreshOriginal().

00078 {
00079 
00080 
00081         GdkPixbuf *buf_imagem;
00082 
00083         buf_imagem = vapiGtkPixbuf (Widget, Image, 1);
00084 
00085         if (buf_imagem == 0)
00086         {
00087                 return;
00088         }
00089         gtk_image_set_from_pixbuf ((GtkImage *) Widget, buf_imagem);
00090 
00091 
00092         /*
00093          * Evitar warnings e crashes quando buf_imagem==NULL.
00094          */
00095         if (buf_imagem != NULL)
00096                 g_object_unref (buf_imagem);
00097 
00098 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkPutImageNotScaled ( GtkWidget *  Widget,
IplImage *  Image 
)

Definido na linha 101 do ficheiro vapiGtkImageAux.c.

Referências vapiGtkPixbuf().

Referenciado por vapiGtkSelectROIActual().

00102 {
00103 
00104 
00105         GdkPixbuf *buf_imagem;
00106 
00107         gtk_widget_set_size_request (Widget, Image->width, Image->height);
00108         buf_imagem = vapiGtkPixbuf (Widget, Image, 0);
00109 
00110         if (buf_imagem == 0)
00111         {
00112                 return;
00113         }
00114 
00115         gtk_image_set_from_pixbuf ((GtkImage *) Widget, buf_imagem);
00116 
00117 
00118         /*
00119          * Evitar warnings e crashes quando buf_imagem==NULL.
00120          */
00121         if (buf_imagem != NULL)
00122                 g_object_unref (buf_imagem);
00123 
00124 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkSaveImage ( GtkWidget *  widget,
vImages Images 
)

Definido na linha 27 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual.

Referenciado por vapiGtkConnectEvents().

00028 {
00029         cvSaveImage ("save.jpg", Images->Actual);
00030 
00031 }

Here is the caller graph for this function:

void vapiGtkSaveSelectedRegion ( GtkWidget *  widget,
vapiTemp1Struct temp 
)

Definido na linha 470 do ficheiro vapiGtkEvents.c.

Referências _vapiTemp1Struct::GetCoordinates, _vapiTemp1Struct::OperationList, OptionsData, _vapiWidgetStruct::OptionsData, _vapiWidgetStruct::OptionsEvents, _vEffect::OptionsSettings, _vapiWidgetStruct::txtOperation, vapiGetOperationFromTxtOperation(), vapiGtkOptionsBlockEvents(), vapiGtkOptionsGetAssociatedWidget(), vapiGtkOptionsUnBlockEvents(), _vapiGtkGetCoordinates::Vertice e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00471 {
00472         GtkWidget *Coordinate;
00473         int i;
00474         vEffect *Operation;
00475         if (temp->GetCoordinates->Vertice[0].x < 0 ||
00476             temp->GetCoordinates->Vertice[0].y < 0 ||
00477             temp->GetCoordinates->Vertice[1].x < 0 ||
00478             temp->GetCoordinates->Vertice[1].y < 0 ||
00479             temp->GetCoordinates->Vertice[2].x < 0 ||
00480             temp->GetCoordinates->Vertice[2].y < 0 ||
00481             temp->GetCoordinates->Vertice[3].x < 0 ||
00482             temp->GetCoordinates->Vertice[3].y < 0)
00483         {
00484                 return;
00485         }
00486         Operation =
00487                 vapiGetOperationFromTxtOperation (temp->Widgets->txtOperation,
00488                                                   temp->OperationList);
00489 
00490         if (Operation == NULL)
00491         {
00492                 return;
00493         }
00494         vapiGtkOptionsBlockEvents (&temp->Widgets->OptionsEvents);
00495         for (i = 0; i < 4; i++)
00496         {
00497 
00498                 Coordinate =
00499                         vapiGtkOptionsGetAssociatedWidget
00500                         (g_strdup_printf ("d%d", i * 2),
00501                          Operation->OptionsSettings,
00502                          &temp->Widgets->OptionsData);
00503                 gtk_spin_button_set_value ((GtkSpinButton *) Coordinate,
00504                                            temp->GetCoordinates->Vertice[i].
00505                                            x);
00506                 Coordinate =
00507                         vapiGtkOptionsGetAssociatedWidget (g_strdup_printf
00508                                                            ("d%d", i * 2 + 1),
00509                                                            Operation->
00510                                                            OptionsSettings,
00511                                                            &temp->Widgets->
00512                                                            OptionsData);
00513                 gtk_spin_button_set_value ((GtkSpinButton *) Coordinate,
00514                                            temp->GetCoordinates->Vertice[i].
00515                                            y);
00516 
00517         }
00518         vapiGtkOptionsUnBlockEvents (&temp->Widgets->OptionsEvents);
00519 
00520 
00521 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkSaveTemplate ( GtkWidget *  widget,
vapiTemp1Struct temp 
)

Definido na linha 244 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vOptionsSettings::CustomOptionsSettings, _vapiTemp1Struct::GetCoordinates, _vapiTemp1Struct::Images, _vapiWidgetStruct::ImageWindowTemplate, _vEffectSettings::NeedOfAuxImage, NeedTemplate, _vapiTemp1Struct::OperationList, OptionsData, _vEffect::OptionsSettings, _vapiWidgetStruct::txtOperation, vapiGetOperationFromTxtOperation(), vapiGtkOptionsGetAssociatedWidget(), _vapiGtkGetCoordinates::Vertice e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00245 {
00246         int x, y, width, height;
00247         IplImage *template;
00248         vEffect *Operation;
00249         vEffectSettings *OperationSettings;
00250         GtkWidget *txtFilename;
00251 
00252         if (temp->GetCoordinates->Vertice[0].x < 0 ||
00253             temp->GetCoordinates->Vertice[0].y < 0 ||
00254             temp->GetCoordinates->Vertice[1].x < 0 ||
00255             temp->GetCoordinates->Vertice[1].y < 0)
00256         {
00257                 return;
00258         }
00259         Operation =
00260                 vapiGetOperationFromTxtOperation (temp->Widgets->txtOperation,
00261                                                   temp->OperationList);
00262         if (Operation == NULL)
00263         {
00264                 return;
00265         }
00266 
00267         OperationSettings = Operation->OptionsSettings->CustomOptionsSettings;
00268         if (OperationSettings->NeedOfAuxImage != NeedTemplate)
00269         {
00270                 return;
00271         }
00272 
00273         txtFilename =
00274                 vapiGtkOptionsGetAssociatedWidget ("c0",
00275                                                    Operation->OptionsSettings,
00276                                                    &temp->Widgets->
00277                                                    OptionsData);
00278         /*
00279          * Por agora não foi definido uma variável que guardasse o caminho do 
00280          *  ficheiro porque aind não foi bem determinado como proceder com strings.
00281          */
00282         if (temp->GetCoordinates->Vertice[0].x <
00283             temp->GetCoordinates->Vertice[1].x)
00284         {
00285                 x = temp->GetCoordinates->Vertice[0].x;
00286                 width = temp->GetCoordinates->Vertice[1].x -
00287                         temp->GetCoordinates->Vertice[0].x;
00288         }
00289         else
00290         {
00291                 x = temp->GetCoordinates->Vertice[1].x;
00292                 width = temp->GetCoordinates->Vertice[0].x -
00293                         temp->GetCoordinates->Vertice[1].x;
00294         }
00295         if (temp->GetCoordinates->Vertice[0].y <
00296             temp->GetCoordinates->Vertice[1].y)
00297         {
00298                 y = temp->GetCoordinates->Vertice[0].y;
00299                 height = temp->GetCoordinates->Vertice[1].y -
00300                         temp->GetCoordinates->Vertice[0].y;
00301         }
00302         else
00303         {
00304                 y = temp->GetCoordinates->Vertice[1].y;
00305                 height = temp->GetCoordinates->Vertice[0].y -
00306                         temp->GetCoordinates->Vertice[1].y;
00307         }
00308 
00309         cvSetImageROI (temp->Images->Actual, cvRect (x, y, width, height));
00310         template =
00311                 cvCreateImage (cvSize (width, height), IPL_DEPTH_8U,
00312                                temp->Images->Actual->nChannels);
00313         cvCopy (temp->Images->Actual, template, NULL);
00314         cvSaveImage (g_strdup_printf
00315                      ("%s.jpg",
00316                       gtk_entry_get_text ((GtkEntry *) temp->GetCoordinates->
00317                                           txtTemplateFilename)), template);
00318         cvReleaseImage (&template);
00319         cvResetImageROI (temp->Images->Actual);
00320 
00321 
00322 
00323         gtk_entry_set_text ((GtkEntry *) txtFilename, g_strdup_printf
00324                             ("%s.jpg",
00325                              gtk_entry_get_text ((GtkEntry *) temp->
00326                                                  GetCoordinates->
00327                                                  txtTemplateFilename)));
00328         /*
00329          * Reset a todas as coordenadas
00330          */
00331         temp->GetCoordinates->Vertice[0].x = -1;
00332         temp->GetCoordinates->Vertice[0].y = -1;
00333         temp->GetCoordinates->Vertice[1].x = -1;
00334         temp->GetCoordinates->Vertice[1].y = -1;
00335         gtk_widget_hide (temp->Widgets->ImageWindowTemplate);
00336 
00337 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkSaveWorkImage ( GtkWidget *  widget,
vapiTemp1Struct temp 
)

Definido na linha 98 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vapiTemp1Struct::Images, _vapiWidgetStruct::imWork, _vapiTemp1Struct::imWork, vapiGtkPutImage(), vImagesFreeActual() e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00099 {
00100         if (temp->imWork == NULL)
00101         {
00102                 return;
00103         }
00104         vImagesFreeActual (temp->Images);
00105         temp->Images->Actual = temp->imWork;
00106 
00107         temp->imWork = NULL;
00108         vapiGtkPutImage (temp->Widgets->imWork, temp->Images->Actual);
00109 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkSelectRegion ( GtkWidget *  widget,
GdkEventButton *  event,
vapiGtkGetCoordinates GetCoordinates 
)

Definido na linha 340 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vapiGtkGetCoordinates::Images, v_debug, vapiGtkAuxActual2Work() e _vapiGtkGetCoordinates::Vertice.

Referenciado por vapiGtkConnectEvents().

00343 {
00344 
00345 
00346         int i, j, lineThickness = 1;
00347         char *statusBarText;
00348         vImages *tempImages;
00349         tempImages =
00350                 vapiGtkAuxActual2Work ((vImages *) GetCoordinates->Images);
00351 
00352         statusBarText = g_strdup_printf (" ");
00353         v_debug ("Select Region\n");
00354         if (event->button == 3)
00355         {
00356                 for (i = 0; i < 3; i++)
00357                 {
00358                         if (GetCoordinates->Vertice[i].x > 0
00359                             && GetCoordinates->Vertice[i + 1].x < 0)
00360                         {
00361                                 GetCoordinates->Vertice[i].x = -1;
00362                                 GetCoordinates->Vertice[i].y = -1;
00363                                 --i;
00364                                 break;
00365 
00366                         }
00367 
00368                         if (i > 0 && GetCoordinates->Vertice[i].x > 0)
00369                         {
00370                                 cvLine (tempImages->Actual,
00371                                         GetCoordinates->Vertice[i - 1],
00372                                         GetCoordinates->Vertice[i],
00373                                         CV_RGB (255, 0, 0), lineThickness, 8,
00374                                         0);
00375 
00376                         }
00377                         if (i == 2 && GetCoordinates->Vertice[i + 1].x > 0)
00378                         {
00379                                 GetCoordinates->Vertice[i + 1].x = -1;
00380                                 GetCoordinates->Vertice[i + 1].y = -1;
00381                                 break;
00382                         }
00383                 }
00384                 for (j = 0; j <= i; j++)
00385                 {
00386                         statusBarText = g_strdup_printf
00387                                 ("%s Vertice%d: (%d,%d)",
00388                                  statusBarText, j,
00389                                  GetCoordinates->Vertice[j].x,
00390                                  GetCoordinates->Vertice[j].y);
00391                 }
00392                 gtk_statusbar_push ((GtkStatusbar *) GetCoordinates->
00393                                     stSelectRegion, 0, statusBarText);
00394                 goto putImage;
00395         }
00396 
00397         if (GetCoordinates->Vertice[3].x > 0)
00398         {
00399                 GetCoordinates->Vertice[0].x = -1;
00400                 GetCoordinates->Vertice[0].y = -1;
00401                 GetCoordinates->Vertice[1].x = -1;
00402                 GetCoordinates->Vertice[1].y = -1;
00403                 GetCoordinates->Vertice[2].x = -1;
00404                 GetCoordinates->Vertice[2].y = -1;
00405                 GetCoordinates->Vertice[3].x = -1;
00406                 GetCoordinates->Vertice[3].y = -1;
00407         }
00408 
00409         for (i = 0; i < 4; i++)
00410         {
00411                 if (GetCoordinates->Vertice[i].x > 0)
00412                 {
00413                         if (i > 0)
00414                         {
00415                                 cvLine (tempImages->Actual,
00416                                         GetCoordinates->Vertice[i - 1],
00417                                         GetCoordinates->Vertice[i],
00418                                         CV_RGB (255, 0, 0), lineThickness, 8,
00419                                         0);
00420                         }
00421                         continue;
00422                 }
00423                 else
00424                 {
00425                         gtk_widget_get_pointer (widget,
00426                                                 &GetCoordinates->Vertice[i].x,
00427                                                 &GetCoordinates->Vertice[i].
00428                                                 y);
00429                         for (j = 0; j <= i; j++)
00430                         {
00431                                 statusBarText = g_strdup_printf
00432                                         ("%s Vertice%d: (%d,%d)",
00433                                          statusBarText, j,
00434                                          GetCoordinates->Vertice[j].x,
00435                                          GetCoordinates->Vertice[j].y);
00436                         }
00437                         gtk_statusbar_push ((GtkStatusbar *) GetCoordinates->
00438                                             stSelectRegion, 0, statusBarText);
00439                         if (i > 0)
00440                         {
00441                                 cvLine (tempImages->Actual,
00442                                         GetCoordinates->Vertice[i - 1],
00443                                         GetCoordinates->Vertice[i],
00444                                         CV_RGB (255, 0, 0), lineThickness, 8,
00445                                         0);
00446                         }
00447                         if (i == 3)
00448                         {
00449                                 cvLine (tempImages->Actual,
00450                                         GetCoordinates->Vertice[i],
00451                                         GetCoordinates->Vertice[0],
00452                                         CV_RGB (255, 0, 0), lineThickness, 8,
00453                                         0);
00454                         }
00455                         break;
00456                 }
00457 
00458 
00459         }
00460 
00461       putImage:
00462         vapiGtkPutImageNotScaled ((GtkWidget *) GetCoordinates->
00463                                   imSelectRegion, tempImages->Actual);
00464         vImagesFreeActual (tempImages);
00465         free (tempImages);
00466 
00467 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkSelectROIActual ( GtkWidget *  widget,
GdkEventFocus *  event,
vapiTemp1Struct temp 
)

Definido na linha 112 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vOptionsSettings::CustomOptionsSettings, _vapiTemp1Struct::GetCoordinates, _vapiTemp1Struct::Images, _vapiWidgetStruct::ImageWindow, _vapiWidgetStruct::ImageWindowSelectRegion, _vapiWidgetStruct::ImageWindowTemplate, _vapiWidgetStruct::imSelectRegion, _vapiWidgetStruct::imSelectTemplate, _vapiWidgetStruct::imShowOriginalSize, _vEffectSettings::NeedOfAuxImage, NeedRegion, NeedTemplate, NoNeed, _vapiTemp1Struct::OperationList, _vEffect::OptionsSettings, _vapiWidgetStruct::txtOperation, vapiGetOperationFromTxtOperation(), vapiGtkPutImageNotScaled(), _vapiGtkGetCoordinates::Vertice e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00114 {
00115         vEffect *Operation;
00116         vEffectSettings *OperationSettings;
00117 
00118         Operation =
00119                 vapiGetOperationFromTxtOperation (temp->Widgets->txtOperation,
00120                                                   temp->OperationList);
00121         if (Operation == NULL)
00122         {
00123                 goto NoNeed;
00124                 return;
00125         }
00126         OperationSettings = Operation->OptionsSettings->CustomOptionsSettings;
00127         if (OperationSettings->NeedOfAuxImage == NoNeed)
00128         {
00129               NoNeed:
00130                 gtk_widget_show_all (temp->Widgets->ImageWindow);
00131                 vapiGtkPutImageNotScaled (temp->Widgets->imShowOriginalSize,
00132                                           temp->Images->Actual);
00133                 gtk_window_position ((GtkWindow *) temp->Widgets->
00134                                      ImageWindow, GTK_WIN_POS_CENTER_ALWAYS);
00135                 if (Operation == NULL)
00136                 {
00137                         return;
00138                 }
00139 
00140         }
00141         if (OperationSettings->NeedOfAuxImage == NeedRegion)
00142         {
00143                 temp->GetCoordinates->Vertice[0].x = -1;
00144                 temp->GetCoordinates->Vertice[0].y = -1;
00145                 temp->GetCoordinates->Vertice[1].x = -1;
00146                 temp->GetCoordinates->Vertice[1].y = -1;
00147                 temp->GetCoordinates->Vertice[2].x = -1;
00148                 temp->GetCoordinates->Vertice[2].y = -1;
00149                 temp->GetCoordinates->Vertice[3].x = -1;
00150                 temp->GetCoordinates->Vertice[3].y = -1;
00151 
00152                 gtk_widget_show_all (temp->Widgets->ImageWindowSelectRegion);
00153                 vapiGtkPutImageNotScaled (temp->Widgets->imSelectRegion,
00154                                           temp->Images->Actual);
00155                 gtk_window_position ((GtkWindow *) temp->Widgets->
00156                                      ImageWindowTemplate,
00157                                      GTK_WIN_POS_CENTER_ALWAYS);
00158                 return;
00159 
00160         }
00161         if (OperationSettings->NeedOfAuxImage == NeedTemplate)
00162         {
00163                 temp->GetCoordinates->Vertice[0].x = -1;
00164                 temp->GetCoordinates->Vertice[0].y = -1;
00165                 temp->GetCoordinates->Vertice[1].x = -1;
00166                 temp->GetCoordinates->Vertice[1].y = -1;
00167                 gtk_statusbar_push ((GtkStatusbar *) temp->GetCoordinates->
00168                                     stTemplateWindow, 0, " ");
00169 
00170                 gtk_widget_show_all (temp->Widgets->ImageWindowTemplate);
00171                 vapiGtkPutImageNotScaled (temp->Widgets->imSelectTemplate,
00172                                           temp->Images->Actual);
00173                 gtk_window_position ((GtkWindow *) temp->Widgets->
00174                                      ImageWindowTemplate,
00175                                      GTK_WIN_POS_CENTER_ALWAYS);
00176                 return;
00177         }
00178 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

gboolean vapiGtkShowImageWindow ( GtkWidget *  widget,
GdkEventCrossing *  event,
vapiTemp1Struct temp 
)

gboolean vapiGtkShowImageWindowLeave ( GtkWidget *  widget,
GdkEventCrossing *  event,
vapiTemp1Struct temp 
)

gboolean vapiGtkTemplateDrag ( GtkWidget *  widget,
GdkEventMotion *  event,
vapiGtkGetCoordinates GetCoordinates 
)

Definido na linha 199 do ficheiro vapiGtkEvents.c.

Referências _vImages::Actual, _vapiGtkGetCoordinates::Images, v_debug, vapiGtkAuxActual2Work(), vapiGtkPutImage(), _vapiGtkGetCoordinates::Vertice e vImagesFreeActual().

Referenciado por vapiGtkConnectEvents().

00202 {
00203         vImages *tempImages;
00204         GdkModifierType mask;
00205         gdk_window_get_pointer (gtk_widget_get_parent_window (widget),
00206                                 &GetCoordinates->Vertice[1].x,
00207                                 &GetCoordinates->Vertice[1].y, &mask);
00208         if (mask != GDK_BUTTON1_MASK)
00209         {
00210                 return FALSE;
00211         }
00212 
00213         tempImages =
00214                 vapiGtkAuxActual2Work ((vImages *) GetCoordinates->Images);
00215 
00216         gtk_statusbar_push ((GtkStatusbar *) GetCoordinates->
00217                             stTemplateWindow, 1,
00218                             g_strdup_printf
00219                             ("Vertice[0]: (%d,%d), Vertice[1]: (%d,%d)",
00220                              GetCoordinates->Vertice[0].x,
00221                              GetCoordinates->Vertice[0].y,
00222                              GetCoordinates->Vertice[1].x,
00223                              GetCoordinates->Vertice[1].y));
00224         v_debug ("Coordendas do rato, %d %d",
00225                  GetCoordinates->Vertice[1].x, GetCoordinates->Vertice[1].y);
00226         cvRectangle (tempImages->Actual,
00227                      cvPoint (GetCoordinates->Vertice[0].x,
00228                               GetCoordinates->Vertice[0].y),
00229                      cvPoint (GetCoordinates->Vertice[1].x,
00230                               GetCoordinates->Vertice[1].y),
00231                      CV_RGB (255, 0, 0), 1, 8, 0);
00232         v_debug ("passou o rectangulo");
00233         vapiGtkPutImage ((GtkWidget *) GetCoordinates->
00234                          imSelectTemplate, tempImages->Actual);
00235 
00236         vImagesFreeActual (tempImages);
00237         free (tempImages);
00238 
00239         return FALSE;
00240 
00241 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkToolbarStyle ( GtkWidget *  widget,
GtkWidget *  toolbar 
)

Definido na linha 79 do ficheiro vapiGtkEvents.c.

Referenciado por vapiGtkConnectEvents().

00080 {
00081 
00082         if (gtk_check_menu_item_get_active ((GtkCheckMenuItem *) widget))
00083         {
00084 
00085                 gtk_toolbar_set_style ((GtkToolbar *) toolbar,
00086                                        GTK_TOOLBAR_BOTH);
00087 
00088         }
00089         else
00090         {
00091                 gtk_toolbar_set_style ((GtkToolbar *) toolbar,
00092                                        GTK_TOOLBAR_ICONS);
00093 
00094         }
00095 }

Here is the caller graph for this function:


Documentação das variáveis

GtkWidget* LoadScreen

Definido na linha 20 do ficheiro vapiGtkInterface.h.

Referenciado por interface_os_linux(), main(), vapi_loading_progress_reset(), vapi_loading_progress_step() e vapiGtkSetOriginWindowInit().

GtkWidget* LoadScreenMessage

Definido na linha 22 do ficheiro vapiGtkInterface.h.

Referenciado por main() e vapiGtkAuxStepInProgressBar().

GtkWidget* LoadScreenProgress

Definido na linha 21 do ficheiro vapiGtkInterface.h.

Referenciado por main() e vapiGtkAuxStepInProgressBar().


Gerado em Tue Jul 24 10:36:07 2007 para Vapi por  doxygen 1.5.1