summaryrefslogtreecommitdiff
path: root/src/Options.cxx
diff options
context:
space:
mode:
authorDenis Oliver Kropp <dok@directfb.org>2010-10-21 10:25:07 +0200
committerDenis Oliver Kropp <dok@directfb.org>2010-10-21 10:25:07 +0200
commit3b8109daecc1c12359d27896686ff63b7ec03a22 (patch)
tree3b7e995d2bcd4aa393128c4b0a07cc1ffa40d163 /src/Options.cxx
parentc172b4f8aa3731dd4cf7ae9886c73262c045205e (diff)
downloadpluggit-3b8109daecc1c12359d27896686ff63b7ec03a22.tar.gz
pluggit-3b8109daecc1c12359d27896686ff63b7ec03a22.tar.bz2
pluggit-3b8109daecc1c12359d27896686ff63b7ec03a22.zip
new update mechanism
Diffstat (limited to 'src/Options.cxx')
-rw-r--r--src/Options.cxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Options.cxx b/src/Options.cxx
index 27e8924..f68b0f3 100644
--- a/src/Options.cxx
+++ b/src/Options.cxx
@@ -196,6 +196,48 @@ class Options
}
};
+ public class OptionRectangle extends Option {
+ private DFBRectangle &m_value;
+
+ public OptionRectangle( const char *short_name,
+ const char *long_name,
+ const char *arg_name,
+ const char *arg_desc,
+ DFBRectangle &value ) : Option( short_name, long_name, arg_name, arg_desc ), m_value( value )
+ {
+ }
+
+ public virtual bool Parse( const char *arg ) {
+ if (sscanf( arg, "%d,%d-%dx%d", &m_value.x, &m_value.y, &m_value.w, &m_value.h ) != 4) {
+ D_ERROR( "Option/Rectangle: Invalid argument to '%s' or '%s'!\n", m_short_name, m_long_name );
+ return false;
+ }
+
+ return true;
+ }
+ };
+
+ public class OptionLocation extends Option {
+ private DFBLocation &m_value;
+
+ public OptionLocation( const char *short_name,
+ const char *long_name,
+ const char *arg_name,
+ const char *arg_desc,
+ DFBLocation &value ) : Option( short_name, long_name, arg_name, arg_desc ), m_value( value )
+ {
+ }
+
+ public virtual bool Parse( const char *arg ) {
+ if (sscanf( arg, "%f,%f-%fx%f", &m_value.x, &m_value.y, &m_value.w, &m_value.h ) != 4) {
+ D_ERROR( "Option/Location: Invalid argument to '%s' or '%s'!\n", m_short_name, m_long_name );
+ return false;
+ }
+
+ return true;
+ }
+ };
+
private vector<Option*> m_options;