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

#include <gtk/gtk.h>
#include "vapiOperationsDefault.h"
#include "vapiAux.h"
#include "vapiImagesAux.h"
#include "vapiGtkAuxWindow.h"
#include <string.h>
#include "vapi.h"
#include "vapiCameraAcquisition.h"
#include "vapiMacro.h"
#include "vapiGtkInterface.h"
#include "vapiGtkAux.h"
#include "vapiGtkMemory.h"
#include "vapiMacroXML.h"
#include "vapiGtkOptions.h"
#include "vapiCameraCalibrate.h"
#include "vapiGtkCalibrateCamera.h"

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

Ir para o código fonte deste ficheiro.

Funções

void showWidget (GtkWidget *widget1, GtkWidget *widget2)
void vapiGtkCbLoadStaticImage (GtkWidget *widget, vapiTemp1Struct *temp)
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)
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 vapiGtkTemplateDrag (GtkWidget *widget, GdkEventMotion *event, vapiGtkGetCoordinates *GetCoordinates)
void vapiGtkToolbarStyle (GtkWidget *widget, GtkWidget *toolbar)
void vapiRefreshImageThread (GtkWidget *widget, vRefreshImage *RefreshImage)


Documentação das funções

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 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 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:

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, _vapiWidgetStruct::OptionsData, 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, _vapiTemp1Struct::imWork, _vapiWidgetStruct::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 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:

void vapiRefreshImageThread ( GtkWidget *  widget,
vRefreshImage RefreshImage 
)

Definido na linha 34 do ficheiro vapiGtkEvents.c.

Referências _vRefreshImage::CameraFeed, _vapiTemp1Struct::CameraSettings, _vapiWidgetStruct::cbCam, _vRefreshImage::STOP, _vRefreshImage::Temp, vapiCameraSettingsGetType(), vapiRefreshImage(), vCameraLocalFile e _vapiTemp1Struct::Widgets.

Referenciado por vapiGtkConnectEvents().

00035 {
00036         GError *Error;
00037         if (gtk_toggle_tool_button_get_active
00038             (GTK_TOGGLE_TOOL_BUTTON (RefreshImage->Temp->Widgets->cbCam)))
00039         {
00040                 if (vapiCameraSettingsGetType
00041                     (RefreshImage->Temp->CameraSettings) == vCameraLocalFile)
00042                 {
00043                         gtk_toggle_tool_button_set_active
00044                                 (GTK_TOGGLE_TOOL_BUTTON
00045                                  (RefreshImage->Temp->Widgets->cbCam), FALSE);
00046                         return;
00047                 }
00048                 RefreshImage->STOP = 0;
00049                 RefreshImage->CameraFeed =
00050                         g_thread_create ((GThreadFunc) vapiRefreshImage,
00051                                          RefreshImage, FALSE, &Error);
00052         }
00053 
00054 }

Grafo de chamadas desta função:

Here is the caller graph for this function:


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