* fixed some more GetSupportedSuites implementations

* fixed some local variables names
* fixed the case of some message attribute names


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17734 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-06-06 12:35:27 +00:00
parent a60f5e9c2e
commit f4fc3d626a
9 changed files with 85 additions and 59 deletions
+3 -3
View File
@@ -911,10 +911,10 @@ BApplication::GetSupportedSuites(BMessage *data)
if (!data) if (!data)
return B_BAD_VALUE; return B_BAD_VALUE;
status_t status = data->AddString("Suites", "suite/vnd.Be-application"); status_t status = data->AddString("suites", "suite/vnd.Be-application");
if (status == B_OK) { if (status == B_OK) {
BPropertyInfo PropertyInfo(sPropertyInfo); BPropertyInfo propertyInfo(sPropertyInfo);
status = data->AddFlat("message", &PropertyInfo); status = data->AddFlat("messages", &propertyInfo);
if (status == B_OK) if (status == B_OK)
status = BHandler::GetSupportedSuites(data); status = BHandler::GetSupportedSuites(data);
} }
+1 -1
View File
@@ -471,7 +471,7 @@ BMessage: what = (0x0, or 0)
err = data->AddString("suites", "suite/vnd.Be-handler"); err = data->AddString("suites", "suite/vnd.Be-handler");
if (!err) { if (!err) {
BPropertyInfo propertyInfo(sHandlerPropInfo); BPropertyInfo propertyInfo(sHandlerPropInfo);
err = data->AddFlat("message", &propertyInfo); err = data->AddFlat("messages", &propertyInfo);
} }
} }
+12 -12
View File
@@ -664,11 +664,11 @@ BLooper::ResolveSpecifier(BMessage* msg, int32 index,
string comparisons -- which wouldn't tell the whole story anyway, string comparisons -- which wouldn't tell the whole story anyway,
because of the same name being used for multiple properties. because of the same name being used for multiple properties.
*/ */
BPropertyInfo PropertyInfo(gLooperPropInfo); BPropertyInfo propertyInfo(gLooperPropInfo);
uint32 data; uint32 data;
status_t err = B_OK; status_t err = B_OK;
const char* errMsg = ""; const char* errMsg = "";
if (PropertyInfo.FindMatch(msg, index, specifier, form, property, &data) >= 0) { if (propertyInfo.FindMatch(msg, index, specifier, form, property, &data) >= 0) {
switch (data) { switch (data) {
case BLOOPER_PROCESS_INTERNALLY: case BLOOPER_PROCESS_INTERNALLY:
return this; return this;
@@ -701,10 +701,10 @@ BLooper::ResolveSpecifier(BMessage* msg, int32 index,
property); property);
} }
BMessage Reply(B_MESSAGE_NOT_UNDERSTOOD); BMessage reply(B_MESSAGE_NOT_UNDERSTOOD);
Reply.AddInt32("error", err); reply.AddInt32("error", err);
Reply.AddString("message", errMsg); reply.AddString("message", errMsg);
msg->SendReply(&Reply); msg->SendReply(&reply);
return NULL; return NULL;
} }
@@ -716,10 +716,10 @@ BLooper::GetSupportedSuites(BMessage* data)
if (data == NULL) if (data == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
status_t status = data->AddString("Suites", "suite/vnd.Be-handler"); status_t status = data->AddString("suites", "suite/vnd.Be-handler");
if (status == B_OK) { if (status == B_OK) {
BPropertyInfo PropertyInfo(gLooperPropInfo); BPropertyInfo PropertyInfo(gLooperPropInfo);
status = data->AddFlat("message", &PropertyInfo); status = data->AddFlat("messages", &PropertyInfo);
if (status == B_OK) if (status == B_OK)
status = BHandler::GetSupportedSuites(data); status = BHandler::GetSupportedSuites(data);
} }
@@ -1318,10 +1318,10 @@ BLooper::_QuitRequested(BMessage *msg)
bool shutdown; bool shutdown;
if (msg->IsSourceWaiting() if (msg->IsSourceWaiting()
|| (msg->FindBool("_shutdown_", &shutdown) == B_OK && shutdown)) { || (msg->FindBool("_shutdown_", &shutdown) == B_OK && shutdown)) {
BMessage ReplyMsg(B_REPLY); BMessage replyMsg(B_REPLY);
ReplyMsg.AddBool("result", isQuitting); replyMsg.AddBool("result", isQuitting);
ReplyMsg.AddInt32("thread", fTaskID); replyMsg.AddInt32("thread", fTaskID);
msg->SendReply(&ReplyMsg); msg->SendReply(&replyMsg);
} }
if (isQuitting) if (isQuitting)
+4 -6
View File
@@ -117,14 +117,14 @@ const static rgb_color kRedInputColor = { 255, 152, 152, 255 };
static property_info static property_info
sPropertyList[] = { sPropertyList[] = {
{ {
"Selection", "selection",
{ B_GET_PROPERTY, 0 }, { B_GET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Returns the current selection.", 0, "Returns the current selection.", 0,
{ B_INT32_TYPE, 0 } { B_INT32_TYPE, 0 }
}, },
{ {
"Selection", "selection",
{ B_SET_PROPERTY, 0 }, { B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Sets the current selection.", 0, "Sets the current selection.", 0,
@@ -990,16 +990,14 @@ BTextView::GetSupportedSuites(BMessage *data)
return B_BAD_VALUE; return B_BAD_VALUE;
status_t err = data->AddString("suites", "suite/vnd.Be-text-view"); status_t err = data->AddString("suites", "suite/vnd.Be-text-view");
if (err != B_OK)
if (err < B_OK)
return err; return err;
BPropertyInfo prop_info(sPropertyList); BPropertyInfo prop_info(sPropertyList);
err = data->AddFlat("messages", &prop_info); err = data->AddFlat("messages", &prop_info);
if (err < B_OK) if (err != B_OK)
return err; return err;
return BView::GetSupportedSuites(data); return BView::GetSupportedSuites(data);
} }
+18 -11
View File
@@ -11,20 +11,24 @@
static property_info static property_info
sPropertyInfo[] = { sPropertyInfo[] = {
{ "ChannelCount", { "ChannelCount",
{ B_GET_PROPERTY, B_SET_PROPERTY, 0 }, { B_GET_PROPERTY, B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, "", 0 }, { B_DIRECT_SPECIFIER, 0 }, NULL, 0, { B_INT32_TYPE }
},
{ "CurrentChannel", { "CurrentChannel",
{ B_GET_PROPERTY, B_SET_PROPERTY, 0 }, { B_GET_PROPERTY, B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, "", 0 }, { B_DIRECT_SPECIFIER, 0 }, NULL, 0, { B_INT32_TYPE }
},
{ "MaxLimitLabel", { "MaxLimitLabel",
{ B_GET_PROPERTY, B_SET_PROPERTY, 0 }, { B_GET_PROPERTY, B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, "", 0 }, { B_DIRECT_SPECIFIER, 0 }, NULL, 0, { B_STRING_TYPE }
},
{ "MinLimitLabel", { "MinLimitLabel",
{ B_GET_PROPERTY, B_SET_PROPERTY, 0 }, { B_GET_PROPERTY, B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, "", 0 }, { B_DIRECT_SPECIFIER, 0 }, NULL, 0, { B_STRING_TYPE }
},
{ 0 } { 0 }
}; };
@@ -201,12 +205,15 @@ BChannelControl::GetSupportedSuites(BMessage *data)
if (data == NULL) if (data == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
data->AddString("suites", "suite/vnd.Be-channel-control"); status_t err = data->AddString("suites", "suite/vnd.Be-channel-control");
BPropertyInfo propertyInfo(sPropertyInfo); BPropertyInfo propertyInfo(sPropertyInfo);
data->AddFlat("messages", &propertyInfo); if (err == B_OK)
err = data->AddFlat("messages", &propertyInfo);
return BControl::GetSupportedSuites(data); if (err == B_OK)
return BControl::GetSupportedSuites(data);
return err;
} }
+9 -5
View File
@@ -52,8 +52,9 @@ kHorizontalKnobData[] = {
static property_info static property_info
sPropertyInfo[] = { sPropertyInfo[] = {
{ "Orientation", { "Orientation",
{ B_GET_PROPERTY, B_SET_PROPERTY, 0 }, { B_GET_PROPERTY, B_SET_PROPERTY, 0 },
{ B_DIRECT_SPECIFIER, 0 }, "" }, { B_DIRECT_SPECIFIER, 0 }, NULL, 0, { B_INT32_TYPE }
},
{ 0 } { 0 }
}; };
@@ -438,12 +439,15 @@ BChannelSlider::GetSupportedSuites(BMessage *data)
if (data == NULL) if (data == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
data->AddString("suites", "suite/vnd.Be-channel-slider"); status_t err = data->AddString("suites", "suite/vnd.Be-channel-slider");
BPropertyInfo propInfo(sPropertyInfo); BPropertyInfo propInfo(sPropertyInfo);
data->AddFlat("messages", &propInfo, 1); if (err == B_OK)
err = data->AddFlat("messages", &propInfo);
return inherited::GetSupportedSuites(data); if (err == B_OK)
return BChannelControl::GetSupportedSuites(data);
return err;
} }
+30 -11
View File
@@ -30,23 +30,36 @@ struct track_data {
static property_info sProperties[] = { static property_info sProperties[] = {
{ "Item", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 }, { "Item", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Returns the number of BListItems currently in the list." }, "Returns the number of BListItems currently in the list.", 0, { B_INT32_TYPE }
},
{ "Item", { B_EXECUTE_PROPERTY, 0 }, { B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER, { "Item", { B_EXECUTE_PROPERTY, 0 }, { B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER,
B_RANGE_SPECIFIER, B_REVERSE_RANGE_SPECIFIER, 0 }, B_RANGE_SPECIFIER, B_REVERSE_RANGE_SPECIFIER, 0 },
"Select and invoke the specified items, first removing any existing selection." }, "Select and invoke the specified items, first removing any existing selection."
},
{ "Selection", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 }, { "Selection", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Returns int32 count of items in the selection." }, "Returns int32 count of items in the selection.", 0, { B_INT32_TYPE }
},
{ "Selection", { B_EXECUTE_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 }, { "Selection", { B_EXECUTE_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Invoke items in selection." }, "Invoke items in selection."
},
{ "Selection", { B_GET_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 }, { "Selection", { B_GET_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Returns int32 indices of all items in the selection." }, "Returns int32 indices of all items in the selection.", 0, { B_INT32_TYPE }
},
{ "Selection", { B_SET_PROPERTY, 0 }, { B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER, { "Selection", { B_SET_PROPERTY, 0 }, { B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER,
B_RANGE_SPECIFIER, B_REVERSE_RANGE_SPECIFIER, 0 }, B_RANGE_SPECIFIER, B_REVERSE_RANGE_SPECIFIER, 0 },
"Extends current selection or deselects specified items. Boolean field \"data\" " "Extends current selection or deselects specified items. Boolean field \"data\" "
"chooses selection or deselection." }, "chooses selection or deselection.", 0, { B_BOOL_TYPE }
},
{ "Selection", { B_SET_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 }, { "Selection", { B_SET_PROPERTY, 0 }, { B_DIRECT_SPECIFIER, 0 },
"Select or deselect all items in the selection. Boolean field \"data\" chooses " "Select or deselect all items in the selection. Boolean field \"data\" chooses "
"selection or deselection." }, "selection or deselection.", 0, { B_BOOL_TYPE }
},
}; };
@@ -1015,12 +1028,18 @@ BListView::ResolveSpecifier(BMessage* message, int32 index,
status_t status_t
BListView::GetSupportedSuites(BMessage* data) BListView::GetSupportedSuites(BMessage* data)
{ {
if (data == NULL)
return B_BAD_VALUE;
status_t err = data->AddString("suites", "suite/vnd.Be-list-view");
BPropertyInfo propertyInfo(sProperties); BPropertyInfo propertyInfo(sProperties);
if (err == B_OK)
err = data->AddFlat("messages", &propertyInfo);
data->AddString("suites", "suite/vnd.Be-list-view"); if (err == B_OK)
data->AddFlat("messages", &propertyInfo); return BView::GetSupportedSuites(data);
return err;
return BView::GetSupportedSuites(data);
} }
// Perform // Perform
+6 -8
View File
@@ -3480,14 +3480,12 @@ BView::GetSupportedSuites(BMessage *data)
if (data == NULL) if (data == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
status_t status = data->AddString("Suites", "suite/vnd.Be-view"); status_t status = data->AddString("suites", "suite/vnd.Be-view");
if (status == B_OK) { BPropertyInfo propertyInfo(sViewPropInfo);
BPropertyInfo propertyInfo(sViewPropInfo); if (status == B_OK)
status = data->AddFlat("messages", &propertyInfo);
status = data->AddFlat("message", &propertyInfo); if (status == B_OK)
if (status == B_OK) return BHandler::GetSupportedSuites(data);
status = BHandler::GetSupportedSuites(data);
}
return status; return status;
} }
+2 -2
View File
@@ -2217,11 +2217,11 @@ BWindow::GetSupportedSuites(BMessage *data)
if (data == NULL) if (data == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
status_t status = data->AddString("Suites", "suite/vnd.Be-window"); status_t status = data->AddString("suites", "suite/vnd.Be-window");
if (status == B_OK) { if (status == B_OK) {
BPropertyInfo propertyInfo(sWindowPropInfo, sWindowValueInfo); BPropertyInfo propertyInfo(sWindowPropInfo, sWindowValueInfo);
status = data->AddFlat("message", &propertyInfo); status = data->AddFlat("messages", &propertyInfo);
if (status == B_OK) if (status == B_OK)
status = BLooper::GetSupportedSuites(data); status = BLooper::GetSupportedSuites(data);
} }