#include <gtk/gtk.h>
#include <string.h>
#include <stdlib.h>
#include "vapiOperationsDefault.h"
#include "vapiString.h"
#include "vapiAux.h"
#include "vapiGroups.h"
#include "vapiImagesAux.h"
#include "vapiCameraAcquisition.h"
#include "vapiOperationOptions.h"
#include "vapiTypes.h"
#include "vapiGtkInterface.h"
#include "vapiGtkAux.h"
#include "vapiCameraSettings.h"
#include "vapiOperationList.h"
#include "vapiGtkMemory.h"
#include "vapiGtkAuxWindow.h"
#include "vapiGtkImages.h"
#include "vapiGtkMacrosTables.h"
Diagrama de dependências de inclusão para vapiGtkAux.c:
Ir para o código fonte deste ficheiro.
Funções | |
gint | gtk_utils_get_selected_radio_index (GSList *radio_button_group) |
void | v_gtk_message (const char *Message) |
GtkWidget * | vapiAuxCreateIcon (const char *filename) |
void | vapiCamStop (GtkWidget *widget, vRefreshImage *RefreshImage) |
int | vapiCheckOperations (vEffect *Operation, vOptions *options, vMacroList *MacroList) |
vEffect * | vapiGetOperationFromTxtOperation (GtkWidget *txtOperation, vOperationList *OperationList) |
vImages * | vapiGtkAuxActual2Work (vImages *Images) |
vBoolean | vapiGtkAuxCheckOperation (vEffect *Operation) |
void | vapiGtkAuxStepInProgressBar (const char *Message, double Step) |
void | vapiGtkGroupButtons (vGroupList *GroupList, GList **GroupButtonList, GtkWidget *vBoxGroups, GCallback callback, gpointer data) |
int | vapiGtkSelectGroupButton (GtkWidget *ActiveButton, vGroupList *GroupList, GList **GroupButtonList) |
void | vapiRefreshImage (vRefreshImage *RefreshImage) |
gboolean | vapiRefreshOriginal (vRefreshImage *RefreshImage) |
gint gtk_utils_get_selected_radio_index | ( | GSList * | radio_button_group | ) |
Definido na linha 144 do ficheiro vapiGtkAux.c.
00145 { 00146 int k; 00147 int length = g_slist_length (radio_button_group); 00148 for (k = 0; radio_button_group; 00149 k++, radio_button_group = radio_button_group->next) 00150 { 00151 gpointer *radio_button = radio_button_group->data; 00152 if (gtk_check_menu_item_get_active 00153 ((GtkCheckMenuItem *) radio_button)) 00154 return (length - 1) - k; 00155 } 00156 00157 return -1; 00158 }
void v_gtk_message | ( | const char * | Message | ) |
Definido na linha 239 do ficheiro vapiGtkAux.c.
00240 { 00241 /* 00242 * Futuramente a função para descrever mensagens na interface 00243 * do programa. 00244 */ 00245 printf (" "); 00246 }
GtkWidget* vapiAuxCreateIcon | ( | const char * | filename | ) |
Definido na linha 173 do ficheiro vapiGtkAux.c.
00174 { 00175 GtkWidget *icon; 00176 GtkIconSource *icon_source; 00177 GtkIconSet *icon_set; 00178 icon_set = gtk_icon_set_new (); 00179 icon_source = gtk_icon_source_new (); 00180 gtk_icon_source_set_filename (icon_source, filename); 00181 gtk_icon_set_add_source (icon_set, icon_source); 00182 icon = gtk_image_new_from_icon_set (icon_set, 00183 GTK_ICON_SIZE_LARGE_TOOLBAR); 00184 return icon; 00185 }
void vapiCamStop | ( | GtkWidget * | widget, | |
vRefreshImage * | RefreshImage | |||
) |
Definido na linha 70 do ficheiro vapiGtkAux.c.
Referências _vapiWidgetStruct::cbCam, _vRefreshImage::STOP, _vRefreshImage::Temp e _vapiTemp1Struct::Widgets.
Referenciado por vapiGtkConnectEvents().
00071 { 00072 if (!gtk_toggle_tool_button_get_active 00073 ((GtkToggleToolButton *) RefreshImage->Temp->Widgets->cbCam)) 00074 { 00075 gtk_tool_button_set_label ((GtkToolButton *) RefreshImage-> 00076 Temp->Widgets->cbCam, 00077 "Verificar Câmara"); 00078 RefreshImage->STOP = 1; 00079 } 00080 else 00081 { 00082 gtk_tool_button_set_label ((GtkToolButton *) RefreshImage-> 00083 Temp->Widgets->cbCam, 00084 "Aceitar Imagem"); 00085 } 00086 }
Here is the caller graph for this function:
int vapiCheckOperations | ( | vEffect * | Operation, | |
vOptions * | options, | |||
vMacroList * | MacroList | |||
) |
Definido na linha 89 do ficheiro vapiGtkAux.c.
Referências _vChar::ch, _vOptions::chars, _vOptionsSettings::charsNumber, _vOptions::CustomOptions, _vOptionsSettings::CustomOptionsSettings, MacroList, _vMacroHeader::MacroName, _vEffectOptions::Macros, _vEffect::name, _vEffect::OptionsSettings, v_debug, vapiMacroListMacroExist() e vapiMacroListSelectItem().
Referenciado por vapiGtkMacroAppendItem(), vapiGtkMacroInsertItem(), vapiGtkOperationApply() e vapiMacroFromXML().
00091 { 00092 vMacroHeader *MacroHeader; 00093 vEffectSettings *OperationSettings = 00094 Operation->OptionsSettings->CustomOptionsSettings; 00095 vEffectOptions *OperationOptions = options->CustomOptions; 00096 int MacroNumber, i; 00097 if (!strcmp (Operation->name, "Executar Tarefa")) 00098 { 00099 if ((MacroNumber = 00100 vapiMacroListMacroExist (MacroList, 00101 options->chars[0].ch, 0)) >= 0 00102 && strcmp (options->chars[0].ch, "")) 00103 { 00104 MacroHeader = 00105 vapiMacroListSelectItem ((vMacroList 00106 *) 00107 MacroList, 00108 MacroNumber); 00109 v_debug ("nome da macro %s\n", 00110 MacroHeader->MacroName); 00111 OperationOptions->Macros = MacroHeader; 00112 } 00113 else 00114 { 00115 v_debug ("Não existe a Macro desejada %s", 00116 options->chars[0].ch); 00117 OperationOptions->Macros = NULL; 00118 return 1; 00119 } 00120 } 00121 if (Operation->OptionsSettings->charsNumber) 00122 { 00123 for (i = 0; i < Operation->OptionsSettings->charsNumber; i++) 00124 { 00125 if (strlen (options->chars[i].ch) == 0) 00126 { 00127 return 1; 00128 } 00129 } 00130 00131 } 00132 if (OperationSettings->NeedOfAuxImage == NeedTemplate) 00133 { 00134 vOptionsFreeTemplate (options); 00135 ((vEffectOptions *) options->CustomOptions)->Template = 00136 cvLoadImage (options->chars[0].ch, 3); 00137 } 00138 00139 return 0; 00140 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
vEffect* vapiGetOperationFromTxtOperation | ( | GtkWidget * | txtOperation, | |
vOperationList * | OperationList | |||
) |
Definido na linha 217 do ficheiro vapiGtkAux.c.
Referências OperationList e vapiOperationListSelectOperation().
Referenciado por vapiGtkMacroAppendItem(), vapiGtkMacroInsertItem(), vapiGtkOperationApply(), vapiGtkOperationShowOptions(), vapiGtkSaveSelectedRegion(), vapiGtkSaveTemplate() e vapiGtkSelectROIActual().
00218 { 00219 char *OperationName; 00220 vEffect *Operation; 00221 OperationName = 00222 (char *) gtk_entry_get_text ((GtkEntry *) txtOperation); 00223 Operation = 00224 vapiOperationListSelectOperation (OperationList, 00225 OperationName); 00226 return Operation; 00227 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
Definido na linha 161 do ficheiro vapiGtkAux.c.
Referências _vImages::Actual, _vImages::Original, vapiImagesSameSize() e vImagesInit().
Referenciado por vapiGtkSelectRegion() e vapiGtkTemplateDrag().
00162 { 00163 vImages *tempImages = vImagesInit (); 00164 tempImages->Original = Images->Original; 00165 tempImages->Actual = 00166 vapiImagesSameSize (Images->Actual, 00167 Images->Actual->nChannels); 00168 cvCopy (Images->Actual, tempImages->Actual, NULL); 00169 return tempImages; 00170 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
Definido na linha 327 do ficheiro vapiGtkAux.c.
Referências v_error_ui(), vFALSE e vTRUE.
Referenciado por vapiGtkMacroAppendItem(), vapiGtkMacroInsertItem() e vapiGtkOperationApply().
00328 { 00329 if (Operation == NULL) 00330 { 00331 v_error_ui("Nenhuma Operação seleccionada."); 00332 return vTRUE; 00333 } 00334 return vFALSE; 00335 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
void vapiGtkAuxStepInProgressBar | ( | const char * | Message, | |
double | Step | |||
) |
Definido na linha 188 do ficheiro vapiGtkAux.c.
Referências LoadScreenMessage, LoadScreenProgress, MainLoadDone e v_error().
Referenciado por vapi_loading_progress_step().
00189 { 00190 00191 00192 gtk_label_set_text ((GtkLabel *) LoadScreenMessage, Message); 00193 gtk_progress_bar_set_fraction ((GtkProgressBar *) 00194 LoadScreenProgress, Step); 00195 /* 00196 * Retirado do bluefish. 00197 * Serve para que o Splash screen Funcione antes do main loop. 00198 * Dá um passo no loop. 00199 */ 00200 if (!MainLoadDone) 00201 { 00202 00203 while (g_main_context_pending (NULL)) 00204 { 00205 g_main_context_iteration (NULL, TRUE); 00206 } 00207 } 00208 else 00209 { 00210 v_error ("%f main load not done\n", Step); 00211 } 00212 00213 00214 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
void vapiGtkGroupButtons | ( | vGroupList * | GroupList, | |
GList ** | GroupButtonList, | |||
GtkWidget * | vBoxGroups, | |||
GCallback | callback, | |||
gpointer | data | |||
) |
Definido na linha 249 do ficheiro vapiGtkAux.c.
Referências vapiGroupListCountElements() e vapiGroupListSelectItem().
Referenciado por vapiGtkSelectOperationStartWindow() e vapiGtkWindowIOAddInit().
00253 { 00254 int NumberOfGroups, i; 00255 GtkWidget *GroupToggleButton; 00256 00257 char *GroupName; 00258 00259 00260 NumberOfGroups = vapiGroupListCountElements (GroupList); 00261 00262 if (NumberOfGroups == 0) 00263 { 00264 return; 00265 } 00266 00267 for (i = 0; i < NumberOfGroups; i++) 00268 { 00269 GroupName = vapiGroupListSelectItem (GroupList, i); 00270 00271 GroupToggleButton = 00272 gtk_toggle_button_new_with_label (GroupName); 00273 g_signal_connect (G_OBJECT (GroupToggleButton), "toggled", 00274 callback, data); 00275 if (i == 0) 00276 { 00277 gtk_toggle_button_set_active ((GtkToggleButton *) 00278 GroupToggleButton, 00279 TRUE); 00280 } 00281 *GroupButtonList = 00282 g_list_append (*GroupButtonList, GroupToggleButton); 00283 gtk_box_pack_start ((GtkBox *) vBoxGroups, 00284 GroupToggleButton, FALSE, FALSE, 2); 00285 00286 } 00287 gtk_widget_show_all (vBoxGroups); 00288 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
int vapiGtkSelectGroupButton | ( | GtkWidget * | ActiveButton, | |
vGroupList * | GroupList, | |||
GList ** | GroupButtonList | |||
) |
Definido na linha 291 do ficheiro vapiGtkAux.c.
Referenciado por vapiGtkSelectOperationSelectGroup() e vapiGtkWindowIOAddSelectGroup().
00293 { 00294 char *GroupName; 00295 GtkWidget *GroupButton; 00296 int i, NumberOfGroups, selected = 0; 00297 if (!gtk_toggle_button_get_active ((GtkToggleButton *) ActiveButton)) 00298 { 00299 return -1; 00300 } 00301 00302 GroupName = 00303 (char *) gtk_button_get_label ((GtkButton *) ActiveButton); 00304 00305 NumberOfGroups = g_list_length (*GroupButtonList); 00306 00307 00308 for (i = 0; i < NumberOfGroups; i++) 00309 { 00310 GroupButton = g_list_nth_data (*GroupButtonList, i); 00311 if (GroupButton != ActiveButton) 00312 { 00313 00314 00315 gtk_toggle_button_set_active ((GtkToggleButton *) 00316 GroupButton, FALSE); 00317 } 00318 else 00319 { 00320 selected = i; 00321 } 00322 } 00323 return selected; 00324 }
Here is the caller graph for this function:
void vapiRefreshImage | ( | vRefreshImage * | RefreshImage | ) |
Definido na linha 23 do ficheiro vapiGtkAux.c.
Referências _vapiTemp1Struct::CameraSettings, gtkImActual, gtkImOriginal, gtkImWork, _vapiTemp1Struct::Images, _vImages::Original, _vRefreshImage::STOP, _vRefreshImage::Temp, v_info(), vapiCameraSettingsGetType(), vapiGetSnapshot(), vapiGtkImagesFastUpdateInterface(), vapiGtkImagesUpdateInterface(), vapiImagesCopy(), vapiOriginal2Actual(), vCameraLocalFile, vImagesFreeOriginal() e vImagesInit().
Referenciado por vapiRefreshImageThread().
00024 { 00025 vCameraSettings *CameraSettings = RefreshImage->Temp->CameraSettings; 00026 vImages *tempImages = vImagesInit (); 00027 tempImages->Original = 00028 vapiImagesCopy (RefreshImage->Temp->Images->Original); 00029 v_info ("iniciar a Câmara\n"); 00030 00031 do 00032 { 00033 if (vapiCameraSettingsGetType (CameraSettings) == 00034 vCameraLocalFile) 00035 { 00036 continue; 00037 } 00038 else 00039 { 00040 vImagesFreeOriginal (tempImages); 00041 if (!vapiGetSnapshot (tempImages, CameraSettings)) 00042 { 00043 00044 00045 /* 00046 * Informar a outra thread de que pode actualizar 00047 * a imagem. 00048 */ 00049 vapiGtkImagesFastUpdateInterface 00050 (tempImages->Original, gtkImOriginal); 00051 00052 } 00053 00054 g_usleep (10); 00055 } 00056 } 00057 while (RefreshImage->STOP == 0); 00058 if (vapiCameraSettingsGetType (CameraSettings) != vCameraLocalFile) 00059 { 00060 vapiOriginal2Actual (tempImages); 00061 vapiGtkImagesUpdateInterface (tempImages, gtkImActual); 00062 vapiGtkImagesUpdateInterface (tempImages, gtkImWork); 00063 vapiGtkImagesUpdateInterface (tempImages, gtkImOriginal); 00064 } 00065 free (tempImages); 00066 g_thread_exit (NULL); 00067 }
Grafo de chamadas desta função:
Here is the caller graph for this function:
gboolean vapiRefreshOriginal | ( | vRefreshImage * | RefreshImage | ) |
Definido na linha 230 do ficheiro vapiGtkAux.c.
Referências _vRefreshImage::gate, _vapiTemp1Struct::Images, _vImages::Original, _vRefreshImage::Temp, vapiGtkPutImage() e _vapiTemp1Struct::Widgets.
00231 { 00232 vapiGtkPutImage (RefreshImage->Temp->Widgets-> 00233 imOriginal, RefreshImage->Temp->Images->Original); 00234 RefreshImage->gate = 0; 00235 return TRUE; 00236 }
Grafo de chamadas desta função: