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

#include "vapiGtkInterface.h"
#include "vapiGtkAux.h"
#include "vapiIO.h"
#include "vapiIOXML.h"
#include "vapiIOList.h"
#include "vapiGtkOptions.h"
#include "vapiGtkWindowIOAdd.h"
#include "vapiGtkWindowIOConfigure.h"
#include "vapiGtkTable.h"

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

Ir para o código fonte deste ficheiro.

Estruturas de Dados

struct  _vGtkIOAddWindow

Funções

void vapiGtkWindowIOAdd_Add (GtkWidget *widget, gpointer data)
void vapiGtkWindowIOAddInit (GladeXML *xml)
void vapiGtkWindowIOAddInitIOList ()
void vapiGtkWindowIOAddPopulateGroup (int group)
void vapiGtkWindowIOAddSelectGroup (GtkWidget *button, gpointer data)
void vapiGtkWindowIOAddSelectIO (GtkWidget *widget, GtkTreePath *path, GtkTreeIter *iter, gpointer Data)
void vapiGtkWindowIOAddShowDescription ()

Variáveis

static struct _vGtkIOAddWindow GtkIOAddWindow
GList ** Lists [3]
int SelectedIO


Documentação das funções

void vapiGtkWindowIOAdd_Add ( GtkWidget *  widget,
gpointer  data 
)

Definido na linha 170 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOList, GtkIOAddWindow, _vGtkIOAddWindow::OptionsData, _vIO::OptionsSettings, SelectedIO, v_error(), v_list_get(), vapiGtkOptionsGetOptions(), vapiGtkWindowIOConfiguredList(), vapiIOConfiguredToXML(), vapiIOListConfiguredAdd(), vapiOptionsCheck(), vapiOptionsInit(), vOptionsFree() e _vGtkIOAddWindow::winIOAdd.

Referenciado por vapiGtkWindowIOAddInit().

00171 {
00172         vOptions *Options;
00173         vIO *IO;
00174 
00175         if (SelectedIO < 0)
00176         {
00177                 return;
00178         }
00179         IO = v_list_get (GlobalIOList, SelectedIO);
00180 
00181         Options = vapiOptionsInit (IO->OptionsSettings);
00182 
00183         vapiGtkOptionsGetOptions (Options, IO->OptionsSettings, NULL,
00184                                   &GtkIOAddWindow.OptionsData);
00185         if (vapiOptionsCheck (IO->OptionsSettings, Options))
00186         {
00187                 vOptionsFree (Options, IO->OptionsSettings, NULL);
00188                 v_error ("Opções incorrectas, preencher as caixas de texto");
00189                 return;
00190         }
00191 
00192         vapiIOListConfiguredAdd (IO, Options);
00193 
00194         vapiGtkWindowIOConfiguredList ();
00195 
00196         gtk_widget_hide (GtkIOAddWindow.winIOAdd);
00197 
00198         vapiIOConfiguredToXML ();
00199 
00200 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddInit ( GladeXML *  xml  ) 

Definido na linha 30 do ficheiro vapiGtkWindowIOAdd.c.

Referências _vGtkIOAddWindow::Auxiliar, GlobalIOGroups, _vGtkIOAddWindow::GroupButtonList, GtkIOAddWindow, _vGtkIOAddWindow::IOAddGroupButtonBox, Lists, _vGtkIOAddWindow::OptionsContainer, _vGtkIOAddWindow::OptionsData, _vGtkIOAddWindow::OptionsEvents, SelectedIO, _vGtkIOAddWindow::tvIOAddGlobalIOList, _vGtkIOAddWindow::txtIOAddDescription, vapiGtkGroupButtons(), vapiGtkWindowIOAdd_Add(), vapiGtkWindowIOAddInitIOList(), vapiGtkWindowIOAddSelectGroup(), vapiGtkWindowIOAddSelectIO(), _vGtkIOAddWindow::vboxIOAddPropertiesMainContainer e _vGtkIOAddWindow::winIOAdd.

Referenciado por interface_os_linux().

00031 {
00032         GtkWidget *btIOAddWinAdd;
00033         GtkCellRenderer *renderer;
00034         GtkIOAddWindow.GroupButtonList = NULL;
00035         SelectedIO = -1;
00036         GtkIOAddWindow.Auxiliar = NULL;
00037         GtkIOAddWindow.OptionsData = NULL;
00038         GtkIOAddWindow.OptionsEvents = NULL;
00039         GtkIOAddWindow.OptionsContainer = 0;
00040 
00041         Lists[0] = &GtkIOAddWindow.Auxiliar;
00042         Lists[1] = &GtkIOAddWindow.OptionsData;
00043         Lists[2] = &GtkIOAddWindow.OptionsEvents;
00044 
00045         GtkIOAddWindow.tvIOAddGlobalIOList =
00046                 glade_xml_get_widget (xml, "tvIOAddGlobalIOList");
00047         GtkIOAddWindow.vboxIOAddPropertiesMainContainer =
00048                 glade_xml_get_widget (xml,
00049                                       "vboxIOAddPropertiesMainContainer");
00050         GtkIOAddWindow.txtIOAddDescription = glade_xml_get_widget (xml,
00051                                                                    "txtIOAddDescription");
00052 
00053         GtkIOAddWindow.winIOAdd = glade_xml_get_widget (xml, "winIOAdd");
00054         GtkIOAddWindow.IOAddGroupButtonBox =
00055                 glade_xml_get_widget (xml, "IOAddGroupButtonBox");
00056         btIOAddWinAdd = glade_xml_get_widget (xml, "btIOAddWinAdd");
00057 
00058         /*
00059          * Iniciar a Tabela de Lista Global.
00060          */
00061         renderer = gtk_cell_renderer_text_new ();
00062         gtk_tree_selection_set_mode (gtk_tree_view_get_selection
00063                                      (GTK_TREE_VIEW
00064                                       (GtkIOAddWindow.tvIOAddGlobalIOList)),
00065                                      GTK_SELECTION_SINGLE);
00066         gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW
00067                                                      (GtkIOAddWindow.
00068                                                       tvIOAddGlobalIOList),
00069                                                      -1, "Nome", renderer,
00070                                                      "text", 0, NULL);
00071 
00072         gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW
00073                                                      (GtkIOAddWindow.
00074                                                       tvIOAddGlobalIOList),
00075                                                      -1, "Tipo",
00076                                                      renderer, "text", 1,
00077                                                      NULL);
00078 
00079         /*
00080          * Iniciar botões de grupos.
00081          */
00082         vapiGtkGroupButtons (GlobalIOGroups,
00083                              &GtkIOAddWindow.GroupButtonList,
00084                              GtkIOAddWindow.IOAddGroupButtonBox,
00085                              G_CALLBACK (vapiGtkWindowIOAddSelectGroup),
00086                              NULL);
00087         vapiGtkWindowIOAddInitIOList ();
00088 
00089 
00090 
00091         //g_signal_connect (G_OBJECT (GtkIOAddWindow.cbGlobalIOList), "changed",
00092         //                G_CALLBACK (vapiGtkWindowIOAddSelectIO), NULL);
00093 
00094         g_signal_connect (G_OBJECT (GtkIOAddWindow.tvIOAddGlobalIOList),
00095                           "row_activated",
00096                           G_CALLBACK (vapiGtkWindowIOAddSelectIO), NULL);
00097 
00098         g_signal_connect (G_OBJECT (btIOAddWinAdd), "clicked",
00099                           G_CALLBACK (vapiGtkWindowIOAdd_Add), NULL);
00100 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddInitIOList (  ) 

Definido na linha 103 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOList, GtkIOAddWindow, _vIO::IOname, _vIO::IOtype, v_list_count_elements(), v_list_get() e vapiIOTypeToString().

Referenciado por vapiGtkWindowIOAddInit().

00104 {
00105         int i, ListSize;
00106         vIO *IO;
00107         GtkTreeStore *treeStore;
00108         GtkTreeIter iter;
00109 
00110         treeStore = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
00111         ListSize = v_list_count_elements (GlobalIOList);
00112         if (ListSize > 0)
00113         {
00114                 for (i = 0; i < ListSize; i++)
00115                 {
00116                         IO = (vIO *) v_list_get (GlobalIOList, i);
00117                         gtk_tree_store_append (treeStore, &iter, NULL);
00118                         gtk_tree_store_set (treeStore, &iter, 0,
00119                                             IO->IOname, 1,
00120                                             vapiIOTypeToString (IO->IOtype),
00121                                             -1);
00122                 }
00123         }
00124         gtk_tree_view_set_model ((GtkTreeView *) GtkIOAddWindow.
00125                                  tvIOAddGlobalIOList,
00126                                  GTK_TREE_MODEL (treeStore));
00127         g_object_unref (treeStore);
00128 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddPopulateGroup ( int  group  ) 

Definido na linha 234 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOGroups, GlobalIOList, _vIO::Group, GtkIOAddWindow, _vIO::IOname, _vIO::IOtype, v_list_count_elements(), v_list_get(), vapiGroupListSelectItem() e vapiIOTypeToString().

Referenciado por vapiGtkWindowIOAddSelectGroup().

00235 {
00236         int i, NumberOfIO;
00237         GtkTreeStore *treeStore;
00238         GtkTreeIter iter;
00239         GtkTextBuffer *MessagesBuffer;
00240         vIO *IO;
00241         char *GroupName;
00242         if (group == -1)
00243         {
00244                 return;
00245         }
00246         GroupName = vapiGroupListSelectItem (GlobalIOGroups, group);
00247 
00248         treeStore = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
00249         NumberOfIO = v_list_count_elements (GlobalIOList);
00250         if (NumberOfIO == 0)
00251         {
00252                 return;
00253         }
00254 
00255         for (i = 0; i < NumberOfIO; i++)
00256         {
00257                 IO = v_list_get (GlobalIOList, i);
00258 
00259                 if (!strcmp (IO->Group, GroupName)
00260                     || !strcmp ("Todos", GroupName))
00261                 {
00262                         gtk_tree_store_append (treeStore, &iter, NULL);
00263                         gtk_tree_store_set (treeStore, &iter, 0,
00264                                             IO->IOname, 1,
00265                                             vapiIOTypeToString (IO->IOtype),
00266                                             -1);
00267                 }
00268         }
00269 
00270         gtk_tree_view_set_model ((GtkTreeView *) GtkIOAddWindow.
00271                                  tvIOAddGlobalIOList,
00272                                  GTK_TREE_MODEL (treeStore));
00273         gtk_tree_view_columns_autosize ((GtkTreeView *) GtkIOAddWindow.
00274                                         tvIOAddGlobalIOList);
00275         g_object_unref (treeStore);
00276 
00277         /*
00278          * Colocar a caixa da descrição vazia.
00279          */
00280         MessagesBuffer =
00281                 gtk_text_view_get_buffer ((GtkTextView *) GtkIOAddWindow.
00282                                           txtIOAddDescription);
00283 
00284         gtk_text_buffer_set_text (MessagesBuffer, " ", -1);
00285 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddSelectGroup ( GtkWidget *  button,
gpointer  data 
)

Definido na linha 220 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOGroups, _vGtkIOAddWindow::GroupButtonList, GtkIOAddWindow, vapiGtkSelectGroupButton() e vapiGtkWindowIOAddPopulateGroup().

Referenciado por vapiGtkWindowIOAddInit().

00221 {
00222 
00223 
00224         int group;
00225 
00226         group = vapiGtkSelectGroupButton (button,
00227                                           GlobalIOGroups,
00228                                           &GtkIOAddWindow.GroupButtonList);
00229 
00230         vapiGtkWindowIOAddPopulateGroup (group);
00231 
00232 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddSelectIO ( GtkWidget *  widget,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  Data 
)

Definido na linha 131 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOList, GtkIOAddWindow, Lists, _vGtkIOAddWindow::OptionsContainer, _vIO::OptionsSettings, SelectedIO, v_list_get(), vapiGtkOptionsCreate(), vapiGtkOptionsFree(), vapiGtkTableGetValueFromSelection(), vapiGtkWindowIOAddShowDescription(), vapiIOListSelectN(), vapiOptionsInit(), _vGtkIOAddWindow::vboxIOAddPropertiesMainContainer e vOptionsFree().

Referenciado por vapiGtkWindowIOAddInit().

00133 {
00134         vIO *IO;
00135         vOptions *fakeOptions;
00136         GValue value = {
00137                 0,
00138         };
00139         char *IOName;
00140 
00141         vapiGtkTableGetValueFromSelection (widget, &value, 0);
00142 
00143         IOName = (char *) g_value_get_string (&value);
00144         SelectedIO = vapiIOListSelectN (GlobalIOList, IOName);
00145 
00146 
00147         vapiGtkWindowIOAddShowDescription ();
00148 
00149         if (SelectedIO < 0)
00150         {
00151                 vapiGtkOptionsFree (&GtkIOAddWindow.OptionsContainer, Lists);
00152                 return;
00153         }
00154 
00155         IO = v_list_get (GlobalIOList, SelectedIO);
00156 
00157         fakeOptions = vapiOptionsInit (IO->OptionsSettings);
00158         vapiGtkOptionsCreate
00159                 (GtkIOAddWindow.vboxIOAddPropertiesMainContainer,
00160                  &GtkIOAddWindow.OptionsContainer,
00161                  Lists, fakeOptions, IO->OptionsSettings, NULL, NULL, NULL);
00162         gtk_box_reorder_child ((GtkBox *) GtkIOAddWindow.
00163                                vboxIOAddPropertiesMainContainer,
00164                                GtkIOAddWindow.OptionsContainer, 1);
00165         vOptionsFree (fakeOptions, IO->OptionsSettings, NULL);
00166 
00167 
00168 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiGtkWindowIOAddShowDescription (  ) 

Definido na linha 202 do ficheiro vapiGtkWindowIOAdd.c.

Referências GlobalIOList, GtkIOAddWindow, _vIO::IOdescription, SelectedIO e v_list_get().

Referenciado por vapiGtkWindowIOAddSelectIO().

00203 {
00204         GtkTextBuffer *MessagesBuffer;
00205         vIO *IO;
00206 
00207         MessagesBuffer =
00208                 gtk_text_view_get_buffer ((GtkTextView *) GtkIOAddWindow.
00209                                           txtIOAddDescription);
00210 
00211         if (SelectedIO < 0)
00212         {
00213                 gtk_text_buffer_set_text (MessagesBuffer, "", -1);
00214         }
00215         IO = v_list_get (GlobalIOList, SelectedIO);
00216         gtk_text_buffer_set_text (MessagesBuffer, IO->IOdescription, -1);
00217 
00218 }

Grafo de chamadas desta função:

Here is the caller graph for this function:


Documentação das variáveis

struct _vGtkIOAddWindow GtkIOAddWindow [static]

Referenciado por vapiGtkWindowIOAdd_Add(), vapiGtkWindowIOAddInit(), vapiGtkWindowIOAddInitIOList(), vapiGtkWindowIOAddPopulateGroup(), vapiGtkWindowIOAddSelectGroup(), vapiGtkWindowIOAddSelectIO() e vapiGtkWindowIOAddShowDescription().

GList** Lists[3]

Definido na linha 25 do ficheiro vapiGtkWindowIOAdd.c.

Referenciado por vapiGtkOperationShowOptions(), vapiGtkWindowIOAddInit() e vapiGtkWindowIOAddSelectIO().

int SelectedIO

Definido na linha 27 do ficheiro vapiGtkWindowIOAdd.c.

Referenciado por vapiGtkWindowIOAdd_Add(), vapiGtkWindowIOAddInit(), vapiGtkWindowIOAddSelectIO() e vapiGtkWindowIOAddShowDescription().


Gerado em Tue Jul 24 10:37:01 2007 para Vapi por  doxygen 1.5.1