- enum pgc_type { menu_pgc, title_pgc };
- typedef std::pair<pgc_type, int> pgc_ref;
+ enum pgc_type { unknown_pgc, menu_pgc, title_pgc };
+
+ struct pgc_ref
+ {
+ explicit pgc_ref(pgc_type type = unknown_pgc,
+ int index = -1,
+ int sub_index = 0)
+ : type(type), index(index), sub_index(sub_index)
+ {}
+ bool operator==(const pgc_ref & other) const
+ {
+ return type == other.type && index == other.index;
+ }
+ bool operator!=(const pgc_ref & other) const
+ {
+ return !(*this == other);
+ }
+
+ pgc_type type; // Menu or title reference?
+ unsigned index; // Menu or title index (within resp. vector)
+ unsigned sub_index; // Button or chapter number (1-based; 0 if
+ // unspecified; not compared!)
+ };