[dali_2.3.23] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / command-line-options.h
1 #ifndef DALI_INTERNAL_COMMAND_LINE_OPTIONS_H
2 #define DALI_INTERNAL_COMMAND_LINE_OPTIONS_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <cstdint> // int32_t
23 #include <string>
24
25 namespace Dali
26 {
27 namespace Internal
28 {
29 namespace Adaptor
30 {
31 /**
32  * Parses the passed command line arguments and sets the values stored within this
33  * class appropriately.
34  *
35  * The following options are supported:
36  *
37  * @code
38  *  -w|--width          Stage Width
39  *  -h|--height         Stage Height
40  *  -d|--dpi            Emulated DPI
41  *     --help           Help
42  * @endcode
43  *
44  * When the above options are found, they are stripped from argv, and argc is updated appropriately.
45  */
46 struct CommandLineOptions
47 {
48 public:
49   /**
50    * Constructor
51    * @param[in,out]  argc  The number of arguments
52    * @param[in,out]  argv  The argument list
53    * @note Supported options are stripped from argv, and argc is updated appropriately.
54    */
55   CommandLineOptions(int32_t* argc, char** argv[]);
56
57   /**
58    * Destructor
59    */
60   ~CommandLineOptions();
61
62 public:                    // Command line parsed values
63   int32_t     stageWidth;  ///< The width of the stage required.  0 if not set.
64   int32_t     stageHeight; ///< The height of the stage required.   0 if not set.
65   std::string stageDPI;    ///< DPI stored as hxv, where h is horizontal DPI and v is vertical DPI
66 };
67
68 } // namespace Adaptor
69
70 } // namespace Internal
71
72 } // namespace Dali
73
74 #endif // DALI_INTERNAL_COMMAND_LINE_OPTIONS_H