00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 #include "app_peakfind.h"
00082
00083 static void DSPPeakFind_about( void );
00084 static void DSPPeakFind_query( void );
00085 static void DSPPeakFind_cleanup( void );
00086
00087 static void DSPPeakFind_show_callback( GtkWidget*, void* );
00088
00089 GxsmPlugin DSPPeakFind_pi = {
00090 NULL,
00091 NULL,
00092 0,
00093 NULL,
00094 "DSPPeakFind",
00095 "+spaHARD +SPALEED",
00096 NULL,
00097 "Percy Zahl",
00098 N_("_Windows/"),
00099 N_("DSP PeakFind"),
00100 N_("open the DSP Peak Finder controlwindow"),
00101 "DSP peak find control",
00102 NULL,
00103 NULL,
00104 NULL,
00105 DSPPeakFind_query,
00106 DSPPeakFind_about,
00107 NULL,
00108 NULL,
00109 DSPPeakFind_cleanup
00110 };
00111
00112 static const char *about_text = N_("Gxsm DSPPeakFind Plugin:\n"
00113 "This plugin runs a controls window to send "
00114 "general \"PeakFind-Requests\" to the DSP. "
00115 "PeakFindmodes are used to follow and monitor"
00116 "Peakintensities by SPA-LEED."
00117 );
00118
00119 GxsmPlugin *get_gxsm_plugin_info ( void ){
00120 DSPPeakFind_pi.description = g_strdup_printf(N_("Gxsm DSPPeakFind plugin %s"), VERSION);
00121 return &DSPPeakFind_pi;
00122 }
00123
00124 DSPPeakFindControl *DSPPeakFindClass = NULL;
00125
00126 GSList *DSPPF_RemoteActionList = NULL;
00127
00128
00129
00130 static void DSPPeakFind_query(void)
00131 {
00132 static GnomeUIInfo menuinfo[] = {
00133 { GNOME_APP_UI_ITEM,
00134 DSPPeakFind_pi.menuentry, DSPPeakFind_pi.help,
00135 (gpointer) DSPPeakFind_show_callback, NULL,
00136 NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BLANK,
00137 0, GDK_CONTROL_MASK, NULL },
00138
00139 GNOMEUIINFO_END
00140 };
00141
00142 PI_DEBUG (DBG_L2, "Query: Insert Menu Entry" );
00143
00144 gnome_app_insert_menus(GNOME_APP(DSPPeakFind_pi.app->getApp()),
00145 DSPPeakFind_pi.menupath, menuinfo);
00146
00147
00148
00149 PI_DEBUG (DBG_L2, "Query: Create PF Control Class " );
00150
00151 DSPPeakFindClass = new DSPPeakFindControl
00152 ( DSPPeakFind_pi.app->xsm->hardware,
00153 & DSPPeakFind_pi.app->RemoteEntryList
00154 );
00155
00156 DSPPeakFindClass->SetResName ("WindowPeakFindControl", "false", xsmres.geomsave);
00157
00158
00159
00160
00161 if(DSPPeakFind_pi.status) g_free(DSPPeakFind_pi.status);
00162 DSPPeakFind_pi.status = g_strconcat(N_("Plugin query has attached "),
00163 DSPPeakFind_pi.name,
00164 N_(": DSPPeakFind is created."),
00165 NULL);
00166 }
00167
00168 static void DSPPeakFind_about(void)
00169 {
00170 const gchar *authors[] = { "Percy Zahl", NULL};
00171 gtk_widget_show(gnome_about_new ( DSPPeakFind_pi.name,
00172 VERSION,
00173 N_("(C) 2000 the Free Software Foundation"),
00174 about_text,
00175 authors,
00176 NULL, NULL, NULL
00177 ));
00178 }
00179
00180
00181 static void remove_from_gapp_ralist(remote_action_cb* ra, gpointer data){
00182 PI_DEBUG (DBG_L2, "Remove_Remote List" );
00183 gapp->RemoteActionList = g_slist_remove
00184 (gapp->RemoteActionList, ra);
00185 g_free(ra->cmd);
00186 g_free(ra);
00187 }
00188
00189 static void DSPPeakFind_cleanup( void ){
00190 PI_DEBUG (DBG_L2, "Cleanup: removing MenuEntry" );
00191
00192 gchar *mp = g_strconcat(DSPPeakFind_pi.menupath, DSPPeakFind_pi.menuentry, NULL);
00193 gnome_app_remove_menus (GNOME_APP( DSPPeakFind_pi.app->getApp() ), mp, 1);
00194 g_free(mp);
00195
00196 PI_DEBUG (DBG_L2, "DSPPeakFind Plugin Cleanup: Window" );
00197
00198
00199
00200 if(DSPPF_RemoteActionList){
00201 g_slist_foreach(DSPPF_RemoteActionList, (GFunc) remove_from_gapp_ralist, NULL);
00202 g_slist_free(DSPPF_RemoteActionList);
00203 }
00204
00205
00206 if( DSPPeakFindClass )
00207 delete DSPPeakFindClass ;
00208
00209 DSPPeakFindClass = NULL;
00210 PI_DEBUG (DBG_L2, "DSPPeakFind Plugin Cleanup: done." );
00211 }
00212
00213 static void DSPPeakFind_show_callback( GtkWidget* widget, void* data){
00214 if( DSPPeakFindClass )
00215 DSPPeakFindClass->show();
00216 }