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

#include <gtk/gtk.h>
#include "vapiGtkInterface.h"
#include "vapiGtkAux.h"
#include "vapiAux.h"
#include "vapiGtkAuxWindow.h"
#include "vapiGtkWindowSelectOperation.h"
#include "vapiOperationList.h"
#include "vapiGroups.h"
#include "vapiCameraSettings.h"
#include "vapiGtkSetOriginWindow.h"
#include "vapiGtkWindowIOAdd.h"
#include "vapiGtkWindowIOConfigure.h"
#include "vapiGtkImages.h"
#include "vapiGtkMacrosTables.h"
#include "vapiGtkMacroItemMove.h"
#include "vapiGtkEventsMacros.h"
#include "vapiGtkMessages.h"

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

Ir para o código fonte deste ficheiro.

Funções

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


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, _vapiGtkWindowSelectGroupStruct::OperationList, 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, _vapiWidgetStruct::txtOperation, _vapiGtkWindowSelectGroupStruct::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:

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:

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:


Gerado em Tue Jul 24 10:35:58 2007 para Vapi por  doxygen 1.5.1