diff options
| author | Manolo Gouy <Manolo> | 2016-03-28 09:25:11 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-28 09:25:11 +0000 |
| commit | 6284720098cb3682f950db427c95ac87c2a10b3c (patch) | |
| tree | dbcfaa3ff88b889c91856f79136a6e25cf7ca914 /src/drivers/Darwin | |
| parent | 3dfec155adf812941e4478b210d1bee4dbd56c01 (diff) | |
Rewrite file src/Fl_arg.cxx under the driver model. Begin giving flesh to the Fl_System_Driver class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11448 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Darwin')
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.cxx | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index edba76686..a95bac019 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -41,6 +41,8 @@ class Fl_Darwin_System_Driver : public Fl_System_Driver { public: + virtual int single_arg(const char *arg); + virtual int arg_and_value(const char *name, const char *value); }; #endif // FL_DARWIN_SYSTEM_DRIVER_H diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index fa6893784..bbab50be9 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -19,6 +19,7 @@ #include "../../config_lib.h" #include "Fl_Darwin_System_Driver.H" +#include <string.h> //const char* fl_local_alt = "\xe2\x8c\xa5\\"; // U+2325 (option key) const char* fl_local_alt = "⌥\\"; // U+2325 (option key) @@ -29,6 +30,22 @@ const char* fl_local_meta = "⌘\\"; // U+2318 (place of interest sign) //const char* fl_local_shift = "\xe2\x87\xa7\\"; // U+21E7 (upwards white arrow) const char* fl_local_shift = "⇧\\"; // U+21E7 (upwards white arrow) +Fl_System_Driver *Fl_System_Driver::driver() { + static Fl_System_Driver *d = new Fl_Darwin_System_Driver(); + return d; +} + +int Fl_Darwin_System_Driver::single_arg(const char *arg) { + // The Finder application in MacOS X passes the "-psn_N_NNNNN" option to all apps. + return (strncmp(arg, "psn_", 4) == 0); +} + +int Fl_Darwin_System_Driver::arg_and_value(const char *name, const char *value) { + // Xcode in MacOS X may pass "-NSDocumentRevisionsDebugMode YES" + return strcmp(name, "NSDocumentRevisionsDebugMode") == 0; +} + + // // End of "$Id$". // |
