summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturectrl.h')
-rw-r--r--indra/newview/lltexturectrl.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 180c4fa4b8..08c530314e 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -64,6 +64,22 @@ bool get_is_predefined_texture(LLUUID asset_id);
LLUUID get_copy_free_item_by_asset_id(LLUUID image_id, bool no_trans_perm = false);
bool get_can_copy_texture(LLUUID image_id);
+enum class LLTexPickInventoryType : U32
+{
+ TEXTURE_MATERIAL = 0,
+ TEXTURE = 1,
+ MATERIAL = 2,
+};
+
+namespace LLInitParam
+{
+ template<>
+ struct TypeValues<LLTexPickInventoryType> : public TypeValuesHelper<LLTexPickInventoryType>
+ {
+ static void declareValues();
+ };
+}
+
enum LLPickerSource
{
PICKER_INVENTORY,
@@ -87,12 +103,11 @@ public:
TEXTURE_CANCEL
} ETexturePickOp;
- typedef enum e_pick_inventory_type
- {
- PICK_TEXTURE_MATERIAL = 0,
- PICK_TEXTURE = 1,
- PICK_MATERIAL = 2,
- } EPickInventoryType;
+ // *HACK: Can't forward-declare an enum scoped inside a class. Maybe there's a better way to initialize LLInitParam::TypeValues<LLTexPickInventoryType> that doesn't run into this limitation.
+ typedef LLTexPickInventoryType EPickInventoryType;
+ static const EPickInventoryType PICK_TEXTURE_MATERIAL = LLTexPickInventoryType::TEXTURE_MATERIAL;
+ static const EPickInventoryType PICK_TEXTURE = LLTexPickInventoryType::TEXTURE;
+ static const EPickInventoryType PICK_MATERIAL = LLTexPickInventoryType::MATERIAL;
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
@@ -100,6 +115,7 @@ public:
Optional<LLUUID> image_id;
Optional<LLUUID> default_image_id;
Optional<std::string> default_image_name;
+ Optional<EPickInventoryType> pick_type;
Optional<bool> allow_no_texture;
Optional<bool> can_apply_immediately;
Optional<bool> no_commit_on_selection; // alternative mode: commit occurs and the widget gets dirty
@@ -117,6 +133,7 @@ public:
: image_id("image"),
default_image_id("default_image_id"),
default_image_name("default_image_name"),
+ pick_type("pick_type", PICK_TEXTURE),
allow_no_texture("allow_no_texture", false),
can_apply_immediately("can_apply_immediately"),
no_commit_on_selection("no_commit_on_selection", false),
@@ -267,7 +284,7 @@ private:
S32 mLabelWidth;
bool mOpenTexPreview;
bool mBakeTextureEnabled;
- LLTextureCtrl::EPickInventoryType mInventoryPickType;
+ EPickInventoryType mInventoryPickType;
};
//////////////////////////////////////////////////////////////////////////////////////////