1/// ************************************************************* 2/// 3/// Licensed to the Apache Software Foundation (ASF) under one 4/// or more contributor license agreements. See the NOTICE file 5/// distributed with this work for additional information 6/// regarding copyright ownership. The ASF licenses this file 7/// to you under the Apache License, Version 2.0 (the 8/// "License"); you may not use this file except in compliance 9/// with the License. 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, 14/// software distributed under the License is distributed on an 15/// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16/// KIND, either express or implied. See the License for the 17/// specific language governing permissions and limitations 18/// under the License. 19/// 20/// ************************************************************* 21#include <types.h> 22 23namespace gb 24{ 25 class SrsTarget; 26 class ResTarget; 27 class AllLangResTarget; 28 29 class SrsPartTarget : public Target, public HasDependencies, public UsesRsc 30 { 31 private: 32 /// SrsPartTarget s do not need to be explicitly constructed. 33 34 /// They are a helper class for the SrsTarget class. 35 /// They are named after the path of their source file (without 36 /// file extension) from the root of their source repository. 37 SrsPartTarget(String name); 38 friend class SrsTarget; 39 40 /// Platformdependant command to generate the dependencies for the srs target. 41 static const Command command_dep( 42 String srsname, 43 Path sourcefile, 44 List<Path> include, 45 List<String> defs); 46 }; 47 48 class SrsTarget : public Target, public HasDependencies, public IsCleanable 49 { 50 public: 51 /// Sets defines for srs processing. 52 /// \$\$(DEFS) contains the current flags and can be used, if 53 /// just a few need to be modified. 54 void set_defs(List<String> defs); 55 /// Sets the include paths for srs processing. 56 /// \$\$(INCLUDE) contains the current paths and can be used, if 57 /// just a few need to be modified. 58 void set_include(List<String> include); 59 /// Adds a SrsPartTarget to be processed. 60 void add_file(SrsPartTarget part); 61 /// Adds multiple SrsPartTarget s to be processed. 62 void add_files(List<SrsPartTarget> parts); 63 private: 64 /// SrsTarget s do not need to be explicitly constructed. 65 66 /// They are a helper class for the ResTarget class. 67 SrsTarget(String name); 68 friend class ResTarget; 69 70 List<String> DEFS; 71 List<String> INCLUDE 72 List<SrsPartTarget> PARTS; 73 static const List<String> DEFAULTDEFS; 74 }; 75 76 class ResTarget : public Target, public IsCleanable, public HasSrs 77 { 78 public: 79 void add_file(Path file); 80 void add_files(List<Path> files); 81 private: 82 /// ResTarget do not need to be explicitly constructed. 83 84 /// They are a helper class for the AllLangResTarget class. 85 ResTarget(String name, String library, Language lang, Path reslocation); 86 friend class AllLangResTarget; 87 88 String LIBRARY; 89 Language LANGUAGE; 90 Path RESLOCATION; 91 }; 92 93 class AllLangResTarget : public Target, public IsCleanable, public HasSrs 94 { 95 public: 96 AllLangResTarget(String name); 97 /// Sets the location where resources are to be found. reslocation is a path relative to the default_images directory. 98 /// Resources will be found in reslocation itself and in the subdirectories res/ and imglst/ of it and again in subdirectories 99 /// of those named as the language of the processed resource. In addition, resources are found in the res/ directory directly 100 /// below default_images and the subdirectory of it named as the language of the processed resource. 101 void set_reslocation(Path reslocation); 102 private: 103 /// Sets the languages for which to create resources. 104 static void set_langs(List<Language> langs); 105 106 /// The list of languages that need to be build. 107 static List<Language> LANGS; 108 }; 109} 110/* vim: set filetype=cpp : */ 111