From 74e0e786b773c63aa736f8d6d32efae4ca9dbc64 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 2 May 2009 00:51:17 +0000 Subject: [PATCH] Begin work on renovating the Null plugins. (On the Linux side, anyways, though some of that will spill over to the Windows side.) Starting with FWnull. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1105 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/FWnull/FW.c | 147 ---- plugins/FWnull/FW.h | 39 +- plugins/FWnull/Linux/{conf.c => Config.cpp} | 313 +++++---- plugins/FWnull/Linux/Config.h | 9 +- plugins/FWnull/Linux/{Linux.c => Linux.cpp} | 36 +- plugins/FWnull/Linux/{Config.c => Linux.h} | 40 +- plugins/FWnull/Linux/callbacks.c | 34 - plugins/FWnull/Linux/firewire.glade | 743 ++++++++++++-------- plugins/FWnull/Linux/interface.c | 219 ------ plugins/FWnull/Linux/support.c | 162 ----- plugins/FWnull/Linux/support.h | 37 +- plugins/FWnull/Makefile.am | 33 + plugins/FWnull/Windows/FWnull_vc2008.vcproj | 2 +- plugins/FWnull/Windows/Win32.c | 2 +- plugins/FWnull/build.sh | 23 +- plugins/FWnull/configure.ac | 80 +++ plugins/FWnull/install-sh | 1 + plugins/FWnull/missing | 1 + 18 files changed, 849 insertions(+), 1072 deletions(-) delete mode 100644 plugins/FWnull/FW.c rename plugins/FWnull/Linux/{conf.c => Config.cpp} (70%) rename plugins/FWnull/Linux/{Linux.c => Linux.cpp} (80%) rename plugins/FWnull/Linux/{Config.c => Linux.h} (55%) delete mode 100644 plugins/FWnull/Linux/callbacks.c delete mode 100644 plugins/FWnull/Linux/interface.c delete mode 100644 plugins/FWnull/Linux/support.c create mode 100644 plugins/FWnull/Makefile.am create mode 100644 plugins/FWnull/configure.ac create mode 120000 plugins/FWnull/install-sh create mode 120000 plugins/FWnull/missing diff --git a/plugins/FWnull/FW.c b/plugins/FWnull/FW.c deleted file mode 100644 index 5d94cae073..0000000000 --- a/plugins/FWnull/FW.c +++ /dev/null @@ -1,147 +0,0 @@ -/* FWnull - * Copyright (C) 2004-2005 PCSX2 Team - * - * 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 - */ - -#include -#include -#include - -#include "FW.h" - -const unsigned char version = PS2E_FW_VERSION; -const unsigned char revision = 0; -const unsigned char build = 4; // increase that with each version - -static char *libraryName = "FWnull Driver"; - -s8 *fwregs; - -#define fwRs32(mem) (*(s32*)&fwregs[(mem) & 0xffff]) -#define fwRu32(mem) (*(u32*)&fwregs[(mem) & 0xffff]) - - -u32 CALLBACK PS2EgetLibType() { - return PS2E_LT_FW; -} - -char* CALLBACK PS2EgetLibName() { - return libraryName; -} - -u32 CALLBACK PS2EgetLibVersion2(u32 type) { - return (version<<16) | (revision<<8) | build; -} - -void __Log(char *fmt, ...) { - va_list list; - - if (!conf.Log || fwLog == NULL) return; - - va_start(list, fmt); - vfprintf(fwLog, fmt, list); - va_end(list); -} - -s32 CALLBACK FWinit() { - LoadConfig(); -#ifdef FW_LOG - fwLog = fopen("logs/fwLog.txt", "w"); - if (fwLog) setvbuf(fwLog, NULL, _IONBF, 0); - FW_LOG("FWnull plugin version %d,%d\n",revision,build); - FW_LOG("FW init\n"); -#endif - - fwregs = (s8*)malloc(0x10000); - if (fwregs == NULL) { - SysMessage("Error allocating Memory\n"); return -1; - } - - return 0; -} - -void CALLBACK FWshutdown() { - free(fwregs); - -#ifdef FW_LOG - if (fwLog) fclose(fwLog); -#endif -} - -s32 CALLBACK FWopen(void *pDsp) { -#ifdef FW_LOG - FW_LOG("FW open\n"); -#endif - -#ifdef _WIN32 -#else - //Display* dsp = *(Display**)pDsp; -#endif - - return 0; -} - -void CALLBACK FWclose() { -} - - - - -u32 CALLBACK FWread32(u32 addr) { - u32 ret=0; - - switch (addr) { - case 0x1f808410: - ret = 0x8; - break; - - default: - ret = fwRu32(addr); - } -#ifdef FW_LOG - FW_LOG("FW read mem 0x%x: 0x%x\n", addr, ret); -#endif - - return ret; -} - - - -void CALLBACK FWwrite32(u32 addr, u32 value) { - switch (addr) { - default: - fwRu32(addr) = value; - break; - } -#ifdef FW_LOG - FW_LOG("FW write mem 0x%x: 0x%x\n", addr, value); -#endif -} - -void CALLBACK FWirqCallback(void (*callback)()) { - FWirq = callback; -} - - -s32 CALLBACK FWfreeze(int mode, freezeData *data) { - return 0; -} - - -s32 CALLBACK FWtest() { - return 0; -} - diff --git a/plugins/FWnull/FW.h b/plugins/FWnull/FW.h index 56d23fcd2d..d9008a3df7 100644 --- a/plugins/FWnull/FW.h +++ b/plugins/FWnull/FW.h @@ -1,5 +1,5 @@ -/* FWnull - * Copyright (C) 2004-2005 PCSX2 Team +/* FWnull + * Copyright (C) 2004-2009 PCSX2 Team * * 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 @@ -15,15 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - + #ifndef __FW_H__ #define __FW_H__ #include +extern "C" +{ #define FWdefs #include "PS2Edefs.h" +} #ifdef _WIN32 @@ -35,25 +37,32 @@ #include #include -#define __inline inline +#endif +#ifdef _MSC_VER +#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK +#else +#define EXPORT_C_(type) extern "C" type #endif #define FW_LOG __Log -typedef struct { - int Log; +#define fwRs32(mem) (*(s32*)&fwregs[(mem) & 0xffff]) +#define fwRu32(mem) (*(u32*)&fwregs[(mem) & 0xffff]) + +typedef struct +{ + int Log; } Config; -Config conf; -void (*FWirq)(); +extern Config conf; +extern FILE *fwLog; -void SaveConfig(); -void LoadConfig(); +extern void (*FWirq)(); -FILE *fwLog; -void __Log(char *fmt, ...); - -void SysMessage(char *fmt, ...); +extern void __Log(char *fmt, ...); +extern void SysMessage(char *fmt, ...); +extern void SaveConfig(); +extern void LoadConfig(); #endif diff --git a/plugins/FWnull/Linux/conf.c b/plugins/FWnull/Linux/Config.cpp similarity index 70% rename from plugins/FWnull/Linux/conf.c rename to plugins/FWnull/Linux/Config.cpp index fe50bbd14a..515914ca1b 100644 --- a/plugins/FWnull/Linux/conf.c +++ b/plugins/FWnull/Linux/Config.cpp @@ -1,134 +1,179 @@ -/* FireWire - * Copyright (C) 2002-2004 FireWire Team - * - * 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 - */ - -#include -#include -#include -#include -#include -#include - -#include "interface.h" -#include "support.h" -#include "callbacks.h" -#include "FW.h" -#include "Config.h" - -GtkWidget *MsgDlg; - -void OnMsg_Ok() { - gtk_widget_destroy(MsgDlg); - gtk_main_quit(); -} - -void cfgSysMessage(char *fmt, ...) { - GtkWidget *Ok,*Txt; - GtkWidget *Box,*Box1; - va_list list; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0; - - MsgDlg = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER); - gtk_window_set_title(GTK_WINDOW(MsgDlg), "FireWire Msg"); - gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 5); - - Box = gtk_vbox_new(5, 0); - gtk_container_add(GTK_CONTAINER(MsgDlg), Box); - gtk_widget_show(Box); - - Txt = gtk_label_new(msg); - - gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5); - gtk_widget_show(Txt); - - Box1 = gtk_hbutton_box_new(); - gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0); - gtk_widget_show(Box1); - - Ok = gtk_button_new_with_label("Ok"); - gtk_signal_connect (GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL); - gtk_container_add(GTK_CONTAINER(Box1), Ok); - GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT); - gtk_widget_show(Ok); - - gtk_widget_show(MsgDlg); - - gtk_main(); -} - -GtkWidget *About; - -void OnAbout_Ok(GtkButton *button, gpointer user_data) { - gtk_widget_destroy(About); - gtk_main_quit(); -} - -void CFGabout() { - About = create_About(); - gtk_widget_show_all(About); - gtk_main(); -} - -GtkWidget *Conf; - -void OnConf_Ok(GtkButton *button, gpointer user_data) { - SaveConfig(); - - gtk_widget_destroy(Conf); - gtk_main_quit(); -} - -void OnConf_Cancel(GtkButton *button, gpointer user_data) { - gtk_widget_destroy(Conf); - gtk_main_quit(); -} - -void CFGconfigure() { - Conf = create_Config(); - - LoadConfig(); - - gtk_widget_show_all(Conf); - gtk_main(); -} - -long CFGmessage(char *msg) { - cfgSysMessage(msg); - - return 0; -} - -int main(int argc, char *argv[]) { - gtk_init(NULL, NULL); - - if (!strcmp(argv[1], "configure")) { - CFGconfigure(); - } else if (!strcmp(argv[1], "about")) { - CFGabout(); - } else if (!strcmp(argv[1], "message")) { - CFGmessage(argv[2]); - } - - return 0; -} +/* FWnull + * Copyright (C) 2004-2009 PCSX2 Team + * + * 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 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#include "FW.h" +#include "Config.h" + +extern "C" +{ +#include "interface.h" +#include "support.h" +//#include "callbacks.h" +} + +GtkWidget *MsgDlg, *About, *Conf; +extern string s_strIniPath; + +void OnMsg_Ok() +{ + gtk_widget_destroy(MsgDlg); + gtk_main_quit(); +} + +void cfgSysMessage(char *fmt, ...) +{ + GtkWidget *Ok,*Txt; + GtkWidget *Box,*Box1; + va_list list; + char msg[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + if (msg[strlen(msg) - 1] == '\n') msg[strlen(msg)-1] = 0; + + MsgDlg = gtk_window_new (GTK_WINDOW_POPUP); + gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER); + gtk_window_set_title(GTK_WINDOW(MsgDlg), "FireWire Msg"); + gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 5); + + Box = gtk_vbox_new(5, 0); + gtk_container_add(GTK_CONTAINER(MsgDlg), Box); + gtk_widget_show(Box); + + Txt = gtk_label_new(msg); + + gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5); + gtk_widget_show(Txt); + + Box1 = gtk_hbutton_box_new(); + gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0); + gtk_widget_show(Box1); + + Ok = gtk_button_new_with_label("Ok"); + gtk_signal_connect (GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL); + gtk_container_add(GTK_CONTAINER(Box1), Ok); + GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT); + gtk_widget_show(Ok); + + gtk_widget_show(MsgDlg); + + gtk_main(); +} + +void OnAbout_Ok(GtkButton *button, gpointer user_data) +{ + gtk_widget_destroy(About); + gtk_main_quit(); +} + +void CFGabout() +{ + About = create_About(); + gtk_widget_show_all(About); + gtk_main(); +} + +void OnConf_Ok(GtkButton *button, gpointer user_data) { + SaveConfig(); + + gtk_widget_destroy(Conf); + gtk_main_quit(); +} + +void OnConf_Cancel(GtkButton *button, gpointer user_data) +{ + gtk_widget_destroy(Conf); + gtk_main_quit(); +} + +void CFGconfigure() +{ + Conf = create_Config(); + + LoadConfig(); + + gtk_widget_show_all(Conf); + gtk_main(); +} + +long CFGmessage(char *msg) { + cfgSysMessage(msg); + + return 0; +} + +/*int main(int argc, char *argv[]) { + gtk_init(NULL, NULL); + + if (!strcmp(argv[1], "configure")) { + CFGconfigure(); + } else if (!strcmp(argv[1], "about")) { + CFGabout(); + } else if (!strcmp(argv[1], "message")) { + CFGmessage(argv[2]); + } + + return 0; +}*/ + +void LoadConfig() +{ + FILE *f; + char cfg[255]; + + strcpy(cfg, s_strIniPath.c_str()); + f = fopen(cfg, "r"); + if (f == NULL) + { + printf("failed to open %s\n", s_strIniPath.c_str()); + SaveConfig();//save and return + return; + } + //fscanf(f, "options = %hhx\n", &confOptions); + fclose(f); +} + +void SaveConfig() +{ + FILE *f; + char cfg[255]; + + strcpy(cfg, s_strIniPath.c_str()); + f = fopen(cfg,"w"); + if (f == NULL) + { + printf("failed to open %s\n", s_strIniPath.c_str()); + return; + } + + //fprintf(f, "options = %hhx\n", confOptions); + fclose(f); +} + diff --git a/plugins/FWnull/Linux/Config.h b/plugins/FWnull/Linux/Config.h index 21577711de..824a7dafe7 100644 --- a/plugins/FWnull/Linux/Config.h +++ b/plugins/FWnull/Linux/Config.h @@ -1,5 +1,5 @@ -/* USBlinuz - * Copyright (C) 2002-2004 USBlinuz Team +/* FWnull + * Copyright (C) 2004-2009 PCSX2 Team * * 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 @@ -18,3 +18,8 @@ void SaveConf(); void LoadConf(); + +extern long CFGmessage(char *msg); +extern void CFGconfigure(); +extern void cfgSysMessage(char *fmt, ...); +extern void CFGabout(); diff --git a/plugins/FWnull/Linux/Linux.c b/plugins/FWnull/Linux/Linux.cpp similarity index 80% rename from plugins/FWnull/Linux/Linux.c rename to plugins/FWnull/Linux/Linux.cpp index 90fa763510..38d86a5057 100644 --- a/plugins/FWnull/Linux/Linux.c +++ b/plugins/FWnull/Linux/Linux.cpp @@ -1,5 +1,5 @@ -/* FireWire - * Copyright (C) 2002-2004 FireWire Team +/* FWnull + * Copyright (C) 2004-2009 PCSX2 Team * * 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 @@ -26,10 +26,11 @@ #include #include "FW.h" +#include "Config.h" int ExecCfg(char *arg) { - char cfg[256]; + /*char cfg[256]; struct stat buf; strcpy(cfg, "./cfgFWnull"); @@ -61,7 +62,7 @@ int ExecCfg(char *arg) } printf("cfgFWnull file not found!\n"); - return -1; + return -1;*/ } void SysMessage(char *fmt, ...) @@ -74,25 +75,28 @@ void SysMessage(char *fmt, ...) vsprintf(msg, fmt, list); va_end(list); - sprintf(cmd, "message \"%s\"", msg); - ExecCfg(cmd); + //sprintf(cmd, "message \"%s\"", msg); + cfgSysMessage(msg); + //ExecCfg(cmd); } void FWconfigure() { - char *file; - getcwd(file, ArraySize(file)); - chdir("plugins"); - ExecCfg("configure"); - chdir(file); + //char *file; + //getcwd(file, ArraySize(file)); + //chdir("plugins"); + //ExecCfg("configure"); + //chdir(file); + CFGconfigure(); } void FWabout() { - char *file; - getcwd(file, ArraySize(file)); - chdir("plugins"); - ExecCfg("about"); - chdir(file); + //char *file; + //getcwd(file, ArraySize(file)); + //chdir("plugins"); + //ExecCfg("about"); + //chdir(file); + CFGabout(); } diff --git a/plugins/FWnull/Linux/Config.c b/plugins/FWnull/Linux/Linux.h similarity index 55% rename from plugins/FWnull/Linux/Config.c rename to plugins/FWnull/Linux/Linux.h index 70fc156cd5..ed6cd2d1cb 100644 --- a/plugins/FWnull/Linux/Config.c +++ b/plugins/FWnull/Linux/Linux.h @@ -1,5 +1,5 @@ -/* FireWire - * Copyright (C) 2002-2004 USBlinuz Team +/* FWnull + * Copyright (C) 2004-2009 PCSX2 Team * * 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 @@ -14,38 +14,4 @@ * 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 - */ - -#include -#include -#include -#include -#include - -#include "FW.h" - -void LoadConfig() { - FILE *f; - char cfg[256]; - - sprintf(cfg, "%s/.PS2E/FWnull.cfg", getenv("HOME")); - f = fopen(cfg, "r"); - if (f == NULL) { - return; - } - fclose(f); -} - -void SaveConfig() { - FILE *f; - char cfg[256]; - - sprintf(cfg, "%s/.PS2E", getenv("HOME")); - mkdir(cfg, 0755); - sprintf(cfg, "%s/.PS2E/FWnull.cfg", getenv("HOME")); - f = fopen(cfg, "w"); - if (f == NULL) - return; - fclose(f); -} - + */ \ No newline at end of file diff --git a/plugins/FWnull/Linux/callbacks.c b/plugins/FWnull/Linux/callbacks.c deleted file mode 100644 index fa070a7842..0000000000 --- a/plugins/FWnull/Linux/callbacks.c +++ /dev/null @@ -1,34 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - - -void -OnConf_Ok (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnConf_Cancel (GtkButton *button, - gpointer user_data) -{ - -} - - -void -OnAbout_Ok (GtkButton *button, - gpointer user_data) -{ - -} - diff --git a/plugins/FWnull/Linux/firewire.glade b/plugins/FWnull/Linux/firewire.glade index 6644e52247..cef4eab65e 100644 --- a/plugins/FWnull/Linux/firewire.glade +++ b/plugins/FWnull/Linux/firewire.glade @@ -1,300 +1,443 @@ - - - - - FireWire - dev9linuz - - - pixmaps - C - False - False - False - False - False - - - - GtkWindow - Config - 5 - DEV9config - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - False - True - False - - - GtkVBox - vbox1 - 5 - False - 5 - - - GtkFrame - frame2 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkHBox - hbox1 - 5 - True - 5 - - - GtkLabel - label4 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkCombo - GtkCombo_Eth - 130 - False - True - False - True - False - - - 0 - False - False - - - - GtkEntry - GtkCombo:entry - combo-entry1 - True - True - True - 0 - - - - - - - - GtkFrame - frame3 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - - - - GtkHBox - hbox2 - 5 - True - 5 - - - GtkLabel - label5 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkCombo - GtkCombo_Hdd - 130 - False - True - False - True - False - - - 0 - False - False - - - - GtkEntry - GtkCombo:entry - entry1 - True - True - True - 0 - - - - - - - - GtkHButtonBox - hbuttonbox1 - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button1 - True - True - - clicked - OnConf_Ok - Sat, 06 Apr 2002 17:07:56 GMT - - - GTK_RELIEF_NORMAL - - - - GtkButton - button2 - True - True - - clicked - OnConf_Cancel - Sat, 06 Apr 2002 17:08:08 GMT - - - GTK_RELIEF_NORMAL - - - - - - - GtkWindow - About - 5 - DEV9about - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - False - True - False - - - GtkVBox - vbox2 - 5 - False - 5 - - - GtkLabel - label2 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - label3 - - GTK_JUSTIFY_LEFT - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkHButtonBox - hbuttonbox2 - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button3 - True - True - - clicked - OnAbout_Ok - Sun, 07 Apr 2002 03:43:49 GMT - - - GTK_RELIEF_NORMAL - - - - - - + + + + + + + 5 + True + DEV9config + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + True + 5 + + + + True + Device: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + False + True + False + + + + True + True + True + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + + 0 + False + False + + + + + + + + True + Ethernet + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + 5 + True + True + 5 + + + + True + Device: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + False + True + False + + + + True + True + True + True + 0 + + True + * + False + + + + + + True + GTK_SELECTION_BROWSE + + + + True + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + + + + + 0 + False + False + + + + + + + + True + Hdd + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + Ok + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + Cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + + 5 + True + DEV9about + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 5 + True + False + 5 + + + + True + FireWire Driver + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Author: linuzappz <linuzappz@hotmail.com> + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + + + + True + True + True + Ok + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + True + True + + + + + + + diff --git a/plugins/FWnull/Linux/interface.c b/plugins/FWnull/Linux/interface.c deleted file mode 100644 index 10dcc15912..0000000000 --- a/plugins/FWnull/Linux/interface.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#include -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -GtkWidget* -create_Config (void) -{ - GtkWidget *Config; - GtkWidget *vbox1; - GtkWidget *frame2; - GtkWidget *hbox1; - GtkWidget *label4; - GtkWidget *GtkCombo_Eth; - GtkWidget *combo_entry1; - GtkWidget *frame3; - GtkWidget *hbox2; - GtkWidget *label5; - GtkWidget *GtkCombo_Hdd; - GtkWidget *entry1; - GtkWidget *hbuttonbox1; - GtkWidget *button1; - GtkWidget *button2; - - Config = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_object_set_data (GTK_OBJECT (Config), "Config", Config); - gtk_container_set_border_width (GTK_CONTAINER (Config), 5); - gtk_window_set_title (GTK_WINDOW (Config), "DEV9config"); - gtk_window_set_position (GTK_WINDOW (Config), GTK_WIN_POS_CENTER); - - vbox1 = gtk_vbox_new (FALSE, 5); - gtk_widget_ref (vbox1); - gtk_object_set_data_full (GTK_OBJECT (Config), "vbox1", vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (Config), vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5); - - frame2 = gtk_frame_new ("Ethernet"); - gtk_widget_ref (frame2); - gtk_object_set_data_full (GTK_OBJECT (Config), "frame2", frame2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame2); - gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0); - - hbox1 = gtk_hbox_new (TRUE, 5); - gtk_widget_ref (hbox1); - gtk_object_set_data_full (GTK_OBJECT (Config), "hbox1", hbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox1); - gtk_container_add (GTK_CONTAINER (frame2), hbox1); - gtk_container_set_border_width (GTK_CONTAINER (hbox1), 5); - - label4 = gtk_label_new ("Device:"); - gtk_widget_ref (label4); - gtk_object_set_data_full (GTK_OBJECT (Config), "label4", label4, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label4); - gtk_box_pack_start (GTK_BOX (hbox1), label4, FALSE, FALSE, 0); - - GtkCombo_Eth = gtk_combo_new (); - gtk_widget_ref (GtkCombo_Eth); - gtk_object_set_data_full (GTK_OBJECT (Config), "GtkCombo_Eth", GtkCombo_Eth, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (GtkCombo_Eth); - gtk_box_pack_start (GTK_BOX (hbox1), GtkCombo_Eth, FALSE, FALSE, 0); - gtk_widget_set_usize (GtkCombo_Eth, 130, -2); - - combo_entry1 = GTK_COMBO (GtkCombo_Eth)->entry; - gtk_widget_ref (combo_entry1); - gtk_object_set_data_full (GTK_OBJECT (Config), "combo_entry1", combo_entry1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (combo_entry1); - - frame3 = gtk_frame_new ("Hdd"); - gtk_widget_ref (frame3); - gtk_object_set_data_full (GTK_OBJECT (Config), "frame3", frame3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (frame3); - gtk_box_pack_start (GTK_BOX (vbox1), frame3, TRUE, TRUE, 0); - - hbox2 = gtk_hbox_new (TRUE, 5); - gtk_widget_ref (hbox2); - gtk_object_set_data_full (GTK_OBJECT (Config), "hbox2", hbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbox2); - gtk_container_add (GTK_CONTAINER (frame3), hbox2); - gtk_container_set_border_width (GTK_CONTAINER (hbox2), 5); - - label5 = gtk_label_new ("Device:"); - gtk_widget_ref (label5); - gtk_object_set_data_full (GTK_OBJECT (Config), "label5", label5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label5); - gtk_box_pack_start (GTK_BOX (hbox2), label5, FALSE, FALSE, 0); - - GtkCombo_Hdd = gtk_combo_new (); - gtk_widget_ref (GtkCombo_Hdd); - gtk_object_set_data_full (GTK_OBJECT (Config), "GtkCombo_Hdd", GtkCombo_Hdd, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (GtkCombo_Hdd); - gtk_box_pack_start (GTK_BOX (hbox2), GtkCombo_Hdd, FALSE, FALSE, 0); - gtk_widget_set_usize (GtkCombo_Hdd, 130, -2); - - entry1 = GTK_COMBO (GtkCombo_Hdd)->entry; - gtk_widget_ref (entry1); - gtk_object_set_data_full (GTK_OBJECT (Config), "entry1", entry1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (entry1); - - hbuttonbox1 = gtk_hbutton_box_new (); - gtk_widget_ref (hbuttonbox1); - gtk_object_set_data_full (GTK_OBJECT (Config), "hbuttonbox1", hbuttonbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbuttonbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0); - - button1 = gtk_button_new_with_label ("Ok"); - gtk_widget_ref (button1); - gtk_object_set_data_full (GTK_OBJECT (Config), "button1", button1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button1); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1); - GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT); - - button2 = gtk_button_new_with_label ("Cancel"); - gtk_widget_ref (button2); - gtk_object_set_data_full (GTK_OBJECT (Config), "button2", button2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button2); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2); - GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button1), "clicked", - GTK_SIGNAL_FUNC (OnConf_Ok), - NULL); - gtk_signal_connect (GTK_OBJECT (button2), "clicked", - GTK_SIGNAL_FUNC (OnConf_Cancel), - NULL); - - return Config; -} - -GtkWidget* -create_About (void) -{ - GtkWidget *About; - GtkWidget *vbox2; - GtkWidget *label2; - GtkWidget *label3; - GtkWidget *hbuttonbox2; - GtkWidget *button3; - - About = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_object_set_data (GTK_OBJECT (About), "About", About); - gtk_container_set_border_width (GTK_CONTAINER (About), 5); - gtk_window_set_title (GTK_WINDOW (About), "DEV9about"); - gtk_window_set_position (GTK_WINDOW (About), GTK_WIN_POS_CENTER); - - vbox2 = gtk_vbox_new (FALSE, 5); - gtk_widget_ref (vbox2); - gtk_object_set_data_full (GTK_OBJECT (About), "vbox2", vbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox2); - gtk_container_add (GTK_CONTAINER (About), vbox2); - gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5); - - label2 = gtk_label_new ("DEV9linuz Driver"); - gtk_widget_ref (label2); - gtk_object_set_data_full (GTK_OBJECT (About), "label2", label2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label2); - gtk_box_pack_start (GTK_BOX (vbox2), label2, FALSE, FALSE, 0); - - label3 = gtk_label_new ("Author: linuzappz "); - gtk_widget_ref (label3); - gtk_object_set_data_full (GTK_OBJECT (About), "label3", label3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label3); - gtk_box_pack_start (GTK_BOX (vbox2), label3, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT); - - hbuttonbox2 = gtk_hbutton_box_new (); - gtk_widget_ref (hbuttonbox2); - gtk_object_set_data_full (GTK_OBJECT (About), "hbuttonbox2", hbuttonbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbuttonbox2); - gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox2, TRUE, TRUE, 0); - - button3 = gtk_button_new_with_label ("Ok"); - gtk_widget_ref (button3); - gtk_object_set_data_full (GTK_OBJECT (About), "button3", button3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (button3); - gtk_container_add (GTK_CONTAINER (hbuttonbox2), button3); - GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (button3), "clicked", - GTK_SIGNAL_FUNC (OnAbout_Ok), - NULL); - - return About; -} - diff --git a/plugins/FWnull/Linux/support.c b/plugins/FWnull/Linux/support.c deleted file mode 100644 index 65007c9217..0000000000 --- a/plugins/FWnull/Linux/support.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#include - -#include "support.h" - -/* This is an internally used function to check if a pixmap file exists. */ -static gchar* check_file_exists (const gchar *directory, - const gchar *filename); - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* create_dummy_pixmap (GtkWidget *widget); - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -/* This is a dummy pixmap we use when a pixmap can't be found. */ -static char *dummy_pixmap_xpm[] = { -/* columns rows colors chars-per-pixel */ -"1 1 1 1", -" c None", -/* pixels */ -" " -}; - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* -create_dummy_pixmap (GtkWidget *widget) -{ - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - GtkWidget *pixmap; - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, - NULL, dummy_pixmap_xpm); - if (gdkpixmap == NULL) - g_error ("Couldn't create replacement pixmap."); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -static GList *pixmaps_directories = NULL; - -/* Use this function to set the directory containing installed pixmaps. */ -void -add_pixmap_directory (const gchar *directory) -{ - pixmaps_directories = g_list_prepend (pixmaps_directories, - g_strdup (directory)); -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - gchar *found_filename = NULL; - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - GtkWidget *pixmap; - GList *elem; - - if (!filename || !filename[0]) - return create_dummy_pixmap (widget); - - /* We first try any pixmaps directories set by the application. */ - elem = pixmaps_directories; - while (elem) - { - found_filename = check_file_exists ((gchar*)elem->data, filename); - if (found_filename) - break; - elem = elem->next; - } - - /* If we haven't found the pixmap, try the source directory. */ - if (!found_filename) - { - found_filename = check_file_exists ("pixmaps", filename); - } - - if (!found_filename) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return create_dummy_pixmap (widget); - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask, - NULL, found_filename); - if (gdkpixmap == NULL) - { - g_warning ("Error loading pixmap file: %s", found_filename); - g_free (found_filename); - return create_dummy_pixmap (widget); - } - g_free (found_filename); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -/* This is an internally used function to check if a pixmap file exists. */ -static gchar* -check_file_exists (const gchar *directory, - const gchar *filename) -{ - gchar *full_filename; - struct stat s; - gint status; - - full_filename = (gchar*) g_malloc (strlen (directory) + 1 - + strlen (filename) + 1); - strcpy (full_filename, directory); - strcat (full_filename, G_DIR_SEPARATOR_S); - strcat (full_filename, filename); - - status = stat (full_filename, &s); - if (status == 0 && S_ISREG (s.st_mode)) - return full_filename; - g_free (full_filename); - return NULL; -} - diff --git a/plugins/FWnull/Linux/support.h b/plugins/FWnull/Linux/support.h index aee31f935d..a32649e53c 100644 --- a/plugins/FWnull/Linux/support.h +++ b/plugins/FWnull/Linux/support.h @@ -8,6 +8,31 @@ #include +/* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# define Q_(String) g_strip_context ((String), gettext (String)) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define Q_(String) g_strip_context ((String), (String)) +# define N_(String) (String) +#endif + + /* * Public Functions. */ @@ -21,8 +46,6 @@ GtkWidget* lookup_widget (GtkWidget *widget, const gchar *widget_name); -/* get_widget() is deprecated. Use lookup_widget instead. */ -#define get_widget lookup_widget /* Use this function to set the directory containing installed pixmaps. */ void add_pixmap_directory (const gchar *directory); @@ -32,7 +55,15 @@ void add_pixmap_directory (const gchar *directory); * Private Functions. */ -/* This is used to create the pixmaps in the interface. */ +/* This is used to create the pixmaps used in the interface. */ GtkWidget* create_pixmap (GtkWidget *widget, const gchar *filename); +/* This is used to create the pixbufs used in the interface. */ +GdkPixbuf* create_pixbuf (const gchar *filename); + +/* This is used to set ATK action descriptions. */ +void glade_set_atk_action_description (AtkAction *action, + const gchar *action_name, + const gchar *description); + diff --git a/plugins/FWnull/Makefile.am b/plugins/FWnull/Makefile.am new file mode 100644 index 0000000000..708c80c51b --- /dev/null +++ b/plugins/FWnull/Makefile.am @@ -0,0 +1,33 @@ +# Create a shared library libFWnull +AUTOMAKE_OPTIONS = foreign +noinst_LIBRARIES = libFWnull.a +INCLUDES = -I@srcdir@/../../common/include -I@srcdir@/../../3rdparty -I@srcdir@/Linux + +libFWnull_a_CXXFLAGS = $(shell pkg-config --cflags gtk+-2.0) +libFWnull_a_CFLAGS = $(shell pkg-config --cflags gtk+-2.0) + +# Create a shared object by faking an exe (thanks to ODE makefiles) +traplibdir=$(prefix) + +if DEBUGBUILD +preext=d +endif + +EXEEXT=$(preext)@so_ext@ + +traplib_PROGRAMS=libFWnull +libFWnull_SOURCES= +libFWnull_DEPENDENCIES = libFWnull.a +libFWnull_LDFLAGS= @SHARED_LDFLAGS@ +libFWnull_LDFLAGS+=-Wl,-soname,@libFWnull_SONAME@ +libFWnull_LDADD=$(libFWnull_a_OBJECTS) + +libFWnull_a_SOURCES = FW.cpp Linux/Config.cpp Linux/Linux.cpp \ +FW.h Linux/Config.h Linux/Linux.h + +libFWnull_a_SOURCES += \ +Linux/interface.h Linux/support.c \ +Linux/interface.c Linux/support.h \ +Linux/callbacks.c Linux/callbacks.h + +#SUBDIRS = Linux \ No newline at end of file diff --git a/plugins/FWnull/Windows/FWnull_vc2008.vcproj b/plugins/FWnull/Windows/FWnull_vc2008.vcproj index 9f1d86a290..d4d68494b8 100644 --- a/plugins/FWnull/Windows/FWnull_vc2008.vcproj +++ b/plugins/FWnull/Windows/FWnull_vc2008.vcproj @@ -161,7 +161,7 @@ >