app_remote.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 #include "remote.h"
00029 
00030 #define MY_GTK_RESPONSE_RUN   -100
00031 #define MY_GTK_RESPONSE_STOP  -101
00032 #define MY_GTK_RESPONSE_PAUSE -102
00033 
00034 class RemoteControl : public DlgBase, public remote_crtl{
00035 public:
00036   RemoteControl();
00037   ~RemoteControl();
00038 
00039   void run();
00040   static void dlg_clicked(GtkDialog * dialog, gint button_number, RemoteControl *rc);
00041 
00042 //  static void InputFunction(gpointer rc,
00043 //                          gint source_fd,
00044 //                          GdkInputCondition condition);
00045   static gboolean InputFunction (GIOChannel *src,
00046                                  GIOCondition condition,
00047                                  void *rc);
00048   static void Check_ec(Gtk_EntryControl* ec, gpointer arglist){
00049       ec->CheckRemoteCmd((gchar **)arglist);
00050   };
00051   static void CbAction_ra(remote_action_cb* ra, gpointer arglist){
00052       if(ra->cmd && ((gchar**)arglist)[1])
00053           if(! strcmp(((gchar**)arglist)[1], ra->cmd))
00054               (*ra->RemoteCb) (ra->widget, ra->data);
00055   };
00056 
00057   virtual int addcmd(gchar **cmdargvlist);
00058   virtual int checkentry(gchar **cmdargvlist){
00059     g_slist_foreach(gapp->RemoteEntryList, (GFunc) Check_ec, (gpointer)cmdargvlist);
00060     return 0;
00061   };
00062   virtual int checkactions(gchar **cmdargvlist){
00063     g_slist_foreach(gapp->RemoteActionList, (GFunc) CbAction_ra, (gpointer)cmdargvlist);
00064     return 0;
00065   };
00066   virtual void waitfkt(){ gapp->check_events(); };
00067 
00068   void stop();
00069   void pause();
00070   void resume();
00071   void play();
00072 
00073 private:
00074   int pause_flg;
00075   GtkWidget *Dlg;
00076   GtkWidget *list;
00077   gint ncol;
00078   gint op;         // remote open flag
00079   GIOChannel *gio; // IO Channel object, used to watch for remote fifo input
00080 };

Generated on Sat Apr 1 09:03:47 2006 for GXSM by  doxygen 1.4.6