summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rc/ResourceScriptStmt.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-10-06 20:51:20 +0000
committerZachary Turner <zturner@google.com>2017-10-06 20:51:20 +0000
commit420090af89bacc97ce9c9c28eb3d32d0c704ca53 (patch)
treee7e7c3a236813be6ef8dfdcde0f3c7f1ba847fdf /llvm/tools/llvm-rc/ResourceScriptStmt.h
parente9baea817822ec183f521c444b37d257aabbc655 (diff)
downloadbcm5719-llvm-420090af89bacc97ce9c9c28eb3d32d0c704ca53.tar.gz
bcm5719-llvm-420090af89bacc97ce9c9c28eb3d32d0c704ca53.zip
[llvm-rc] Add optional serialization support for DIALOG(EX) resources.
This is part 5 of llvm-rc serialization support. This allows DIALOG and DIALOGEX to serialize if dialog-specific optional statements are provided. These are (as of now): CAPTION, FONT, and STYLE. Notably, FONT statement can take more than two arguments when describing DIALOGEX resources (as in msdn.microsoft.com/en-us/library/windows/desktop/aa381013.aspx). I made some changes to the parser to reflect this fact. Patch by Marek Sokolowski Differential Revision: https://reviews.llvm.org/D37864 llvm-svn: 315104
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceScriptStmt.h')
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptStmt.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptStmt.h b/llvm/tools/llvm-rc/ResourceScriptStmt.h
index 692d2aec5e7..908232940a5 100644
--- a/llvm/tools/llvm-rc/ResourceScriptStmt.h
+++ b/llvm/tools/llvm-rc/ResourceScriptStmt.h
@@ -665,11 +665,13 @@ public:
//
// Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380778(v=vs.85).aspx
class CaptionStmt : public OptionalStmt {
+public:
StringRef Value;
-public:
CaptionStmt(StringRef Caption) : Value(Caption) {}
raw_ostream &log(raw_ostream &) const override;
+ Twine getResourceTypeName() const override { return "CAPTION"; }
+ Error visit(Visitor *V) const override { return V->visitCaptionStmt(this); }
};
// FONT optional statement.
@@ -679,24 +681,31 @@ public:
//
// Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381013(v=vs.85).aspx
class FontStmt : public OptionalStmt {
- uint32_t Size;
- StringRef Typeface;
-
public:
- FontStmt(uint32_t FontSize, StringRef FontName)
- : Size(FontSize), Typeface(FontName) {}
+ uint32_t Size, Weight, Charset;
+ StringRef Name;
+ bool Italic;
+
+ FontStmt(uint32_t FontSize, StringRef FontName, uint32_t FontWeight,
+ bool FontItalic, uint32_t FontCharset)
+ : Size(FontSize), Weight(FontWeight), Charset(FontCharset),
+ Name(FontName), Italic(FontItalic) {}
raw_ostream &log(raw_ostream &) const override;
+ Twine getResourceTypeName() const override { return "FONT"; }
+ Error visit(Visitor *V) const override { return V->visitFontStmt(this); }
};
// STYLE optional statement.
//
// Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381051(v=vs.85).aspx
class StyleStmt : public OptionalStmt {
+public:
uint32_t Value;
-public:
StyleStmt(uint32_t Style) : Value(Style) {}
raw_ostream &log(raw_ostream &) const override;
+ Twine getResourceTypeName() const override { return "STYLE"; }
+ Error visit(Visitor *V) const override { return V->visitStyleStmt(this); }
};
} // namespace rc
OpenPOWER on IntegriCloud