/* * support.c * * Used by main.c for to call related funcitons of AT Commands. * * Copyright (C) 2007 Atul Raut * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include "support.h" #include "callbacks.h" #include "atcmd.h" extern char *buf; extern char *rbuf; extern char *command [ATCMD_TOTAL][ATCMD_LENGTH]; extern char *output [ATCMD_TOTAL][STDIN_BUF_SIZE]; /* Create window */ GtkWidget* ui_create_window (void) { GtkWidget *window; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "AT My Command"); gtk_window_set_position (GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW(window), 480, 640); g_signal_connect (GTK_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL); g_signal_connect (GTK_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL); return window; } /* To add items to tree structure */ GtkTreeModel* ui_create_and_fill_model (void) { int i; GtkTreeStore *treestore; GtkTreeIter toplevel_gsm0707, child_gsm0707[ATCMD_TOTAL]; treestore = gtk_tree_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING); gtk_tree_store_append (treestore, &toplevel_gsm0707, NULL); gtk_tree_store_set (treestore, &toplevel_gsm0707, COL_AT_COMMAND, "GSM 07.07", COL_OUTPUT, "", -1); /* Update data */ for (i=0; i