Skip to content

Commit

Permalink
Protos: Include a discrete MIME type in file_path fields. (#1873)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshDreamland committed Jan 15, 2020
1 parent 90813d2 commit c6849f6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion shared/protos/Background.proto
Expand Up @@ -25,5 +25,5 @@ message Background {
optional uint32 width = 15;
optional uint32 height = 16;

optional string image = 17 [(gmx) = "data", (file_path) = true];
optional string image = 17 [(gmx) = "data", (file_path) = true, (file_kind) = IMAGE];
}
2 changes: 1 addition & 1 deletion shared/protos/Sound.proto
Expand Up @@ -20,7 +20,7 @@ message Sound {

optional Type type = 9 [(gmx) = "types/type"];

optional string data = 10 [(gmx) = "origname", (file_path) = true];
optional string data = 10 [(gmx) = "origname", (file_path) = true, (file_kind) = AUDIO];

optional int32 effects = 11;
optional uint32 bit_rate = 12 [(gmx) = "bitRates/bitRate"];
Expand Down
2 changes: 1 addition & 1 deletion shared/protos/Sprite.proto
Expand Up @@ -35,5 +35,5 @@ message Sprite {
optional uint32 width = 19;
optional uint32 height = 20;

repeated string subimages = 21 [(gmx) = "frames/frame", (file_path) = true];
repeated string subimages = 21 [(gmx) = "frames/frame", (file_path) = true, (file_kind) = IMAGE];
}
39 changes: 26 additions & 13 deletions shared/protos/options.proto
@@ -1,13 +1,26 @@
syntax = "proto2";
package buffers;

import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
optional int32 id_start = 50000;
optional bool file_path = 50001;
optional string resource_ref = 50002;
optional string gmx = 50003;
optional string gmx_id = 50004;
optional string yyp = 50005;
optional string yyp_id = 50006;
}
syntax = "proto2";
package buffers;

enum FileKind {
UNKNOWN = 0;
APPLICATION = 1;
AUDIO = 2;
FONT = 3;
IMAGE = 4;
MODEL = 5;
TEXT = 6;
VIDEO = 7;
}

import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
optional int32 id_start = 50000;
optional bool file_path = 50001;
optional string resource_ref = 50002;
optional string gmx = 50003;
optional string gmx_id = 50004;
optional string yyp = 50005;
optional string yyp_id = 50006;
// When file_path is true, this is the type of file indicated.
optional FileKind file_kind = 50007;
}

0 comments on commit c6849f6

Please sign in to comment.