You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
|
Feb
(23) |
Mar
(6) |
Apr
(6) |
May
(2) |
Jun
(41) |
Jul
(29) |
Aug
(28) |
Sep
(51) |
Oct
(19) |
Nov
(27) |
Dec
|
| 2003 |
Jan
(1) |
Feb
(11) |
Mar
(20) |
Apr
(18) |
May
(23) |
Jun
(18) |
Jul
(13) |
Aug
(49) |
Sep
(20) |
Oct
(3) |
Nov
(24) |
Dec
(1) |
| 2004 |
Jan
(12) |
Feb
(17) |
Mar
(38) |
Apr
(7) |
May
(22) |
Jun
(4) |
Jul
(26) |
Aug
(17) |
Sep
(18) |
Oct
(17) |
Nov
|
Dec
|
| 2005 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(2) |
Oct
|
Nov
(14) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
| 2009 |
Jan
(5) |
Feb
(12) |
Mar
|
Apr
(10) |
May
(7) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(22) |
Dec
(6) |
| 2010 |
Jan
(14) |
Feb
(4) |
Mar
(4) |
Apr
(2) |
May
(3) |
Jun
|
Jul
|
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(39) |
Dec
(3) |
| 2011 |
Jan
(28) |
Feb
(14) |
Mar
(8) |
Apr
(3) |
May
|
Jun
(14) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
|
| 2012 |
Jan
(1) |
Feb
(12) |
Mar
(7) |
Apr
(4) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(11) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
(13) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: CVS C. to T. <the...@li...> - 2019-04-07 14:41:13
|
Revision: 745
http://sourceforge.net/p/themis/code/745
Author: mark_hellegers
Date: 2019-04-07 14:41:11 +0000 (Sun, 07 Apr 2019)
Log Message:
-----------
Use a BLooper instead of BHandler for the HTML parser, so it runs in a separate thread.
Modified Paths:
--------------
trunk/themis/modules/HTMLParser/HTMLParser.cpp
trunk/themis/modules/HTMLParser/HTMLParser.h
Modified: trunk/themis/modules/HTMLParser/HTMLParser.cpp
===================================================================
--- trunk/themis/modules/HTMLParser/HTMLParser.cpp 2019-04-07 02:07:01 UTC (rev 744)
+++ trunk/themis/modules/HTMLParser/HTMLParser.cpp 2019-04-07 14:41:11 UTC (rev 745)
@@ -80,7 +80,7 @@
}
HTMLParser :: HTMLParser(BMessage * aInfo)
- : BHandler("HTMLParser"),
+ : BLooper("HTMLParser"),
PlugClass(aInfo , "HTMLParser") {
mCache = (CachePlug *) PlugMan->FindPlugin(CachePlugin);
@@ -369,7 +369,7 @@
break;
}
default: {
- BHandler::MessageReceived(aMessage);
+ BLooper::MessageReceived(aMessage);
}
}
@@ -376,13 +376,13 @@
}
-bool HTMLParser :: IsHandler() {
+bool HTMLParser :: IsLooper() {
return true;
}
-BHandler * HTMLParser :: Handler() {
+BLooper * HTMLParser :: Looper() {
return this;
Modified: trunk/themis/modules/HTMLParser/HTMLParser.h
===================================================================
--- trunk/themis/modules/HTMLParser/HTMLParser.h 2019-04-07 02:07:01 UTC (rev 744)
+++ trunk/themis/modules/HTMLParser/HTMLParser.h 2019-04-07 14:41:11 UTC (rev 745)
@@ -33,7 +33,7 @@
extern "C" __declspec(dllexport) status_t Shutdown(bool aNow = false);
extern "C" __declspec(dllexport) PlugClass * GetObject();
-class HTMLParser : public BHandler, public PlugClass {
+class HTMLParser : public BLooper, public PlugClass {
private:
// Plugin variables
@@ -75,8 +75,8 @@
HTMLParser(BMessage * aInfo = NULL);
~HTMLParser();
void MessageReceived(BMessage * aMessage);
- bool IsHandler();
- BHandler * Handler();
+ bool IsLooper();
+ BLooper * Looper();
bool IsPersistent();
uint32 PlugID();
char * PlugName();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-04-07 02:07:03
|
Revision: 744
http://sourceforge.net/p/themis/code/744
Author: mark_hellegers
Date: 2019-04-07 02:07:01 +0000 (Sun, 07 Apr 2019)
Log Message:
-----------
Wait for the looper thread to die. Got broken with my rewrite some time back. Added the code back with a comment, so I won't forget.
Also added code to start the looper if a plugin is a looper, so the plugin does not have to do this itself.
Modified Paths:
--------------
trunk/themis/common/plugman.cpp
Modified: trunk/themis/common/plugman.cpp
===================================================================
--- trunk/themis/common/plugman.cpp 2019-03-31 17:06:28 UTC (rev 743)
+++ trunk/themis/common/plugman.cpp 2019-04-07 02:07:01 UTC (rev 744)
@@ -186,6 +186,9 @@
if (plugin->IsHandler()) {
AddHandler(plugin->Handler());
}
+ else if (plugin->IsLooper()) {
+ plugin->Looper()->Run();
+ }
printf("Succesfully got object %s\n", plugin->PlugName());
}
@@ -234,9 +237,15 @@
}
else if (aPlugin->IsLooper()) {
+ thread_id plugin_thread_id = aPlugin->Looper()->Thread();
+ status_t thread_status;
BMessenger messenger(NULL, aPlugin->Looper());
// Use a synchronous message to quit. Don't care about the result?
messenger.SendMessage(&quitMessage, &replyMessage);
+ // Wait for the thread to stop. We only requested the looper to stop.
+ // Does not mean it has already stopped.
+ // We cannot unload the addon until this is done.
+ wait_for_thread(plugin_thread_id, &thread_status);
}
else {
status_t (*Shutdown)(bool);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-03-31 17:06:29
|
Revision: 743
http://sourceforge.net/p/themis/code/743
Author: mark_hellegers
Date: 2019-03-31 17:06:28 +0000 (Sun, 31 Mar 2019)
Log Message:
-----------
Hopefully last bit of whitespace cleanup for testing of svn build.
Modified Paths:
--------------
trunk/themis/modules/MsgViewer/MsgView.hpp
Modified: trunk/themis/modules/MsgViewer/MsgView.hpp
===================================================================
--- trunk/themis/modules/MsgViewer/MsgView.hpp 2019-03-31 16:40:25 UTC (rev 742)
+++ trunk/themis/modules/MsgViewer/MsgView.hpp 2019-03-31 17:06:28 UTC (rev 743)
@@ -80,7 +80,7 @@
If this is null, the addPlugin function can
be used to add to the list.
*/
- MsgView( BMessage * aPluginList = NULL );
+ MsgView(BMessage * aPluginList = NULL);
/// Destructor of the MsgView class.
/**
@@ -96,7 +96,7 @@
@param aMessage The message to handle.
*/
- void MessageReceived( BMessage * aMessage );
+ void MessageReceived(BMessage * aMessage);
/// A function to shut down the window.
bool QuitRequested();
/// A function to add a message to the window.
@@ -108,7 +108,7 @@
@param aMessage The message to add.
@param aSender The sender it is coming from.
*/
- void addMessage( string aMessage, string aSender = "" );
+ void addMessage(string aMessage, string aSender = "");
/// A function to add a plugin to the list.
/**
This function adds a plugin to the list of plugins that have their own
@@ -117,7 +117,7 @@
@param aPlugin The name of the plugin to add.
*/
- void addPlugin( string aPlugin );
+ void addPlugin(string aPlugin);
/// A function to show the messages for a particular sender.
/**
This function shows all the messages that have been sent by
@@ -125,7 +125,7 @@
@param aSender The sender of the messages.
*/
- void showMessages( string aSender );
+ void showMessages(string aSender);
/// A function to show a message.
/**
This function shows the message, given as the argument, at the end
@@ -133,7 +133,7 @@
@param aMessage The message to show.
*/
- void showMessage( string aMessage );
+ void showMessage(string aMessage);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-03-31 16:40:27
|
Revision: 742
http://sourceforge.net/p/themis/code/742
Author: mark_hellegers
Date: 2019-03-31 16:40:25 +0000 (Sun, 31 Mar 2019)
Log Message:
-----------
Yet more whitespace cleanup during testing of svn build.
Modified Paths:
--------------
trunk/themis/modules/DOMView/DOMView.cpp
Modified: trunk/themis/modules/DOMView/DOMView.cpp
===================================================================
--- trunk/themis/modules/DOMView/DOMView.cpp 2019-03-31 15:35:29 UTC (rev 741)
+++ trunk/themis/modules/DOMView/DOMView.cpp 2019-03-31 16:40:25 UTC (rev 742)
@@ -224,9 +224,9 @@
}
}
-void DOMView :: MessageReceived( BMessage * aMessage ) {
+void DOMView :: MessageReceived(BMessage * aMessage) {
- switch ( aMessage->what ) {
+ switch (aMessage->what) {
case SELECTION: {
int32 index = 0;
aMessage->FindInt32( "index", &index );
@@ -237,65 +237,65 @@
TNodePtr found = findNode(documentRoot, firstItem, index, current);
EmptyListView(mAttributes);
EmptyListView(mValues);
- if ( found->hasAttributes() ) {
+ if (found->hasAttributes()) {
TNamedNodeMapPtr attrs = found->getAttributes();
- for ( unsigned int i = 0; i < attrs->getLength(); i++ ) {
- TNodePtr attr = attrs->item( i );
+ for (unsigned int i = 0; i < attrs->getLength(); i++) {
+ TNodePtr attr = attrs->item(i);
BStringItem * attrItem =
- new BStringItem( attr->getNodeName().c_str() );
- mAttributes->AddItem( attrItem );
+ new BStringItem(attr->getNodeName().c_str());
+ mAttributes->AddItem(attrItem);
BStringItem * valueItem =
- new BStringItem( attr->getNodeValue().c_str() );
- mValues->AddItem( valueItem );
+ new BStringItem(attr->getNodeValue().c_str());
+ mValues->AddItem(valueItem);
}
}
else {
BStringItem * attrItem =
- new BStringItem( "No attributes" );
- mAttributes->AddItem( attrItem );
+ new BStringItem("No attributes");
+ mAttributes->AddItem(attrItem);
BStringItem * valueItem =
- new BStringItem( "No values" );
- mValues->AddItem( valueItem );
+ new BStringItem("No values");
+ mValues->AddItem(valueItem);
}
int menuItems = mTextMenu->CountItems();
int32 markedIndex = 0;
- if ( menuItems ) {
+ if (menuItems) {
BMenuItem * marked = mTextMenu->FindMarked();
- if ( marked ) {
- markedIndex = mTextMenu->IndexOf( marked );
+ if (marked) {
+ markedIndex = mTextMenu->IndexOf(marked);
}
}
- for ( int i = 0; i < menuItems; i++ ) {
- delete mTextMenu->RemoveItem( (int32) 0 );
- mTextMenu->SetEnabled( false );
- mText->SetText( "" );
+ for (int i = 0; i < menuItems; i++) {
+ delete mTextMenu->RemoveItem((int32) 0);
+ mTextMenu->SetEnabled(false);
+ mText->SetText("");
mTextMenu->Invalidate();
}
int textNr = 1;
- if ( found->hasChildNodes() ) {
+ if (found->hasChildNodes()) {
TNodeListPtr children = found->getChildNodes();
mSelectedNode = found;
- for ( unsigned int i = 0; i < children->getLength(); i++ ) {
+ for (unsigned int i = 0; i < children->getLength(); i++) {
TNodePtr child = children->item( i );
- if ( child->getNodeType() == TEXT_NODE ) {
+ if (child->getNodeType() == TEXT_NODE) {
mTextMenu->SetEnabled( true );
- BString * itemText = new BString( "Text part " );
+ BString * itemText = new BString("Text part ");
*itemText << textNr;
BMessage * menuChange =
- new BMessage( TEXT_MENU_CHANGED );
+ new BMessage(TEXT_MENU_CHANGED);
// Warning: Adding index of all children
// Makes it easier to find
- menuChange->AddInt32( "index", i );
+ menuChange->AddInt32("index", i);
BMenuItem * item =
- new BMenuItem( itemText->String(), menuChange );
- if ( (int32) i <= markedIndex ) {
- item->SetMarked( true );
- mText->SetText( child->getNodeValue().c_str(),
- child->getNodeValue().size() );
+ new BMenuItem(itemText->String(), menuChange);
+ if ((int32) i <= markedIndex) {
+ item->SetMarked(true);
+ mText->SetText(child->getNodeValue().c_str(),
+ child->getNodeValue().size());
}
- mTextMenu->AddItem( item );
+ mTextMenu->AddItem(item);
textNr++;
}
}
@@ -305,10 +305,10 @@
mAttributes->MakeEmpty();
mValues->MakeEmpty();
int menuItems = mTextMenu->CountItems();
- for ( int i = 0; i < menuItems; i++ ) {
- delete mTextMenu->RemoveItem( (int32) 0 );
+ for (int i = 0; i < menuItems; i++) {
+ delete mTextMenu->RemoveItem((int32) 0);
mTextMenu->SetEnabled( false );
- mText->SetText( "" );
+ mText->SetText("");
mTextMenu->Invalidate();
}
}
@@ -316,11 +316,11 @@
}
case TEXT_MENU_CHANGED: {
int32 index = 0;
- aMessage->FindInt32( "index", &index );
+ aMessage->FindInt32("index", &index);
TNodeListPtr children = mSelectedNode->getChildNodes();
- TNodePtr child = children->item( index );
- mText->SetText( child->getNodeValue().c_str(),
- child->getNodeValue().size() );
+ TNodePtr child = children->item(index);
+ mText->SetText(child->getNodeValue().c_str(),
+ child->getNodeValue().size());
break;
}
}
@@ -333,7 +333,7 @@
}
-void DOMView :: showTree( const TNodePtr aNode, BStringItem * aParent ) {
+void DOMView :: showTree(const TNodePtr aNode, BStringItem * aParent) {
TNodeListPtr children = aNode->getChildNodes();
int length = children->getLength();
@@ -362,7 +362,7 @@
showTree(mDocument, NULL);
}
-void DOMView :: setDocument( TDocumentPtr aDocument ) {
+void DOMView :: setDocument(TDocumentPtr aDocument) {
printf("Setting document\n");
mDocument = aDocument;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-03-31 15:35:31
|
Revision: 741
http://sourceforge.net/p/themis/code/741
Author: mark_hellegers
Date: 2019-03-31 15:35:29 +0000 (Sun, 31 Mar 2019)
Log Message:
-----------
Further whitespace cleanup during testing of svn build.
Modified Paths:
--------------
trunk/themis/modules/DOMView/DOMViewer.cpp
Modified: trunk/themis/modules/DOMView/DOMViewer.cpp
===================================================================
--- trunk/themis/modules/DOMView/DOMViewer.cpp 2019-03-31 01:07:31 UTC (rev 740)
+++ trunk/themis/modules/DOMView/DOMViewer.cpp 2019-03-31 15:35:29 UTC (rev 741)
@@ -103,7 +103,7 @@
}
-void DOMViewer :: MessageReceived( BMessage * aMessage) {
+void DOMViewer :: MessageReceived(BMessage * aMessage) {
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-03-31 01:07:33
|
Revision: 740
http://sourceforge.net/p/themis/code/740
Author: mark_hellegers
Date: 2019-03-31 01:07:31 +0000 (Sun, 31 Mar 2019)
Log Message:
-----------
Whitespace cleanup to test new svn build.
Modified Paths:
--------------
trunk/themis/modules/DOMView/DOMViewer.hpp
Modified: trunk/themis/modules/DOMView/DOMViewer.hpp
===================================================================
--- trunk/themis/modules/DOMView/DOMViewer.hpp 2019-03-30 22:11:29 UTC (rev 739)
+++ trunk/themis/modules/DOMView/DOMViewer.hpp 2019-03-31 01:07:31 UTC (rev 740)
@@ -48,9 +48,9 @@
DOMView * mView;
public:
- DOMViewer( BMessage * aInfo = NULL );
+ DOMViewer(BMessage * aInfo = NULL);
~DOMViewer();
- void MessageReceived( BMessage * aMessage );
+ void MessageReceived(BMessage * aMessage);
bool IsHandler();
BHandler * Handler();
bool IsPersistent();
@@ -58,8 +58,8 @@
char * PlugName();
float PlugVersion();
void Heartbeat();
- status_t ReceiveBroadcast( BMessage * aMessage );
- status_t BroadcastReply( BMessage * aMessage );
+ status_t ReceiveBroadcast(BMessage * aMessage);
+ status_t BroadcastReply(BMessage * aMessage);
uint32 BroadcastTarget();
int32 Type();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2019-03-30 22:11:31
|
Revision: 739
http://sourceforge.net/p/themis/code/739
Author: mark_hellegers
Date: 2019-03-30 22:11:29 +0000 (Sat, 30 Mar 2019)
Log Message:
-----------
- Use a real lock for the write lock, so nobody else can acquire the lock while we have it.
- Add a new cache user properly, so it gets registered with the right usertoken.
- Use the return value from FindUser, so we can set the right writelockowner.
Modified Paths:
--------------
trunk/themis/common/cacheobject.cpp
trunk/themis/common/cacheobject.h
Modified: trunk/themis/common/cacheobject.cpp
===================================================================
--- trunk/themis/common/cacheobject.cpp 2018-03-12 21:55:53 UTC (rev 738)
+++ trunk/themis/common/cacheobject.cpp 2019-03-30 22:11:29 UTC (rev 739)
@@ -148,7 +148,7 @@
BAutolock alock(lock);
if (alock.IsLocked()) {
if (!IsUsedBy(usertoken)) {
- ulist->AddItem(new CacheUser(usertoken));
+ ulist->AddItem(new CacheUser(0, usertoken));
UpdateAccessTime();
}
@@ -203,14 +203,15 @@
bool CacheObject::AcquireWriteLock(uint32 usertoken) {
bool successful=false;
- BAutolock alock(lock);
- if (alock.IsLocked()) {
+ writeLock.Lock();
+ if (writeLock.IsLocked()) {
CacheUser *user=FindUser(usertoken);
if (user==NULL) {
AddUser(usertoken);
- FindUser(usertoken);
+ user = FindUser(usertoken);
+
}
if (writelockowner==NULL) {
@@ -255,12 +256,11 @@
return successful;
}
void CacheObject::ReleaseWriteLock(uint32 usertoken) {
- BAutolock alock(lock);
- if (alock.IsLocked()) {
- if (writelockowner!=NULL) {
- if (writelockowner->Token()==usertoken) {
- writelockowner=NULL;
- }
+
+ if (writelockowner!=NULL) {
+ if (writelockowner->Token()==usertoken) {
+ writelockowner=NULL;
+ writeLock.Unlock();
}
}
Modified: trunk/themis/common/cacheobject.h
===================================================================
--- trunk/themis/common/cacheobject.h 2018-03-12 21:55:53 UTC (rev 738)
+++ trunk/themis/common/cacheobject.h 2019-03-30 22:11:29 UTC (rev 739)
@@ -58,6 +58,7 @@
//! Pointers to the next and previous items in the linked list respectively.
CacheObject *next,*prev;
BLocker lock;
+ BLocker writeLock;
time_t creation_time;
time_t last_access_time;
virtual void UpdateAccessTime();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2018-03-12 21:55:55
|
Revision: 738
http://sourceforge.net/p/themis/code/738
Author: mark_hellegers
Date: 2018-03-12 21:55:53 +0000 (Mon, 12 Mar 2018)
Log Message:
-----------
Faulty comparison caused wrong icons to be displayed for dynamic prefs
views.
Modified Paths:
--------------
trunk/themis/framework/PrefsWin.cpp
Modified: trunk/themis/framework/PrefsWin.cpp
===================================================================
--- trunk/themis/framework/PrefsWin.cpp 2017-01-15 12:07:44 UTC (rev 737)
+++ trunk/themis/framework/PrefsWin.cpp 2018-03-12 21:55:53 UTC (rev 738)
@@ -409,7 +409,7 @@
type = plugin->Type();
name = plugin->SettingsViewLabel();
if (name != NULL) {
- if (type != TARGET_PARSER) {
+ if (type & TARGET_PARSER) {
fListView->AddItem(
new PrefsListItem(
name,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2017-01-15 12:07:47
|
Revision: 737
http://sourceforge.net/p/themis/code/737
Author: mark_hellegers
Date: 2017-01-15 12:07:44 +0000 (Sun, 15 Jan 2017)
Log Message:
-----------
Make sure the all plugins know the plugin is unloaded
Modified Paths:
--------------
trunk/themis/common/plugman.cpp
trunk/themis/common/plugman.h
Modified: trunk/themis/common/plugman.cpp
===================================================================
--- trunk/themis/common/plugman.cpp 2017-01-15 12:05:15 UTC (rev 736)
+++ trunk/themis/common/plugman.cpp 2017-01-15 12:07:44 UTC (rev 737)
@@ -220,11 +220,14 @@
}
-void plugman :: UnloadPlugin(image_id aId, PlugClass * aPlugin) {
+void plugman :: UnloadPlugin(image_id aId, PlugClass * aPlugin, const char * aPath) {
BMessage quitMessage(B_QUIT_REQUESTED);
BMessage replyMessage(B_QUIT_REQUESTED);
+ int32 type = aPlugin->Type();
+ uint32 plugID = aPlugin->PlugID();
+
if (aPlugin->IsHandler()) {
RemoveHandler(aPlugin->Handler());
delete aPlugin;
@@ -249,23 +252,37 @@
delete aPlugin;
}
}
+ mPlugins.erase(aPath);
+
+ map<string, pair<image_id, PlugClass *> >::iterator i = mPlugins.begin();
+ BMessage * msg = new BMessage(PlugInUnLoaded);
+ msg->AddInt32("type", type);
+ msg->AddInt32("command", COMMAND_INFO);
+ msg->AddInt32("plugid", plugID);
+ while (i != mPlugins.end()) {
+ PlugClass * plugin = (*i).second.second;
+ if (plugin) {
+ plugin->ReceiveBroadcast(msg);
+ }
+ i++;
+ }
+ delete msg;
+
unload_add_on(aId);
-
}
void plugman :: UnloadPlugin(const char * aPath) {
string pathString(aPath);
map<string, pair<image_id, PlugClass *> >::iterator i = mPlugins.find(pathString);
- UnloadPlugin((*i).second.first, (*i).second.second);
-
+ UnloadPlugin((*i).second.first, (*i).second.second, aPath);
}
void plugman :: UnloadAllPlugins() {
map<string, pair<image_id, PlugClass *> >::iterator i = mPlugins.begin();
while (i != mPlugins.end()) {
- UnloadPlugin((*i).second.first, (*i).second.second);
+ UnloadPlugin((*i).second.first, (*i).second.second, (*i).first.c_str());
i++;
}
Modified: trunk/themis/common/plugman.h
===================================================================
--- trunk/themis/common/plugman.h 2017-01-15 12:05:15 UTC (rev 736)
+++ trunk/themis/common/plugman.h 2017-01-15 12:07:44 UTC (rev 737)
@@ -76,7 +76,7 @@
void LoadPlugin(BEntry & aEntry);
void LoadDirectory(const char * aDirectory);
- void UnloadPlugin(image_id aId, PlugClass * aPlugin);
+ void UnloadPlugin(image_id aId, PlugClass * aPlugin, const char * aPath);
void UnloadPlugin(const char * aPath);
//! Unload all plug-ins currently in memory.
/*!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2017-01-15 12:05:18
|
Revision: 736
http://sourceforge.net/p/themis/code/736
Author: mark_hellegers
Date: 2017-01-15 12:05:15 +0000 (Sun, 15 Jan 2017)
Log Message:
-----------
Remove autolock as it is not used and can cause a problem on shutdown as
it can be deleted from a different thread than the one currently holding
it.
Modified Paths:
--------------
trunk/themis/common/cacheplug.cpp
trunk/themis/common/cacheplug.h
Modified: trunk/themis/common/cacheplug.cpp
===================================================================
--- trunk/themis/common/cacheplug.cpp 2017-01-15 12:03:24 UTC (rev 735)
+++ trunk/themis/common/cacheplug.cpp 2017-01-15 12:05:15 UTC (rev 736)
@@ -33,8 +33,6 @@
CachePlug::CachePlug(BMessage *info,const char *msg_sys_name)
:PlugClass(info,msg_sys_name)
{
- lock=new BLocker(true); // set up the locking support
- autolock=new BAutolock(lock);// automatically lock when a thread takes control
user_token_value=0;
object_token_value=0;
userlist=NULL;
@@ -50,8 +48,6 @@
userlist=cur;
}
}
- delete autolock;
- delete lock;
}
uint32 CachePlug::Register(uint32 broadcast_target,const char* name)
{
Modified: trunk/themis/common/cacheplug.h
===================================================================
--- trunk/themis/common/cacheplug.h 2017-01-15 12:03:24 UTC (rev 735)
+++ trunk/themis/common/cacheplug.h 2017-01-15 12:05:15 UTC (rev 736)
@@ -54,8 +54,6 @@
uint32 user_token_value; //!< the current user token value; increments with each call to Register
int32 object_token_value; //!< the current cache object token value; increments when requested URLs are found or cache items are created
CacheUser *userlist;//!< the linked list of registered cache users
- BLocker *lock; //!< This object is the locking mechanism used by the autolock.
- BAutolock *autolock; //!< This object automatically locks the cache system when a new thread attempts to access it.
public:
CachePlug(BMessage *info=NULL,const char *msg_sys_name=NULL);
virtual ~CachePlug();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2017-01-15 12:03:27
|
Revision: 735
http://sourceforge.net/p/themis/code/735
Author: mark_hellegers
Date: 2017-01-15 12:03:24 +0000 (Sun, 15 Jan 2017)
Log Message:
-----------
Simplify handling of unloading of cache plugin
Modified Paths:
--------------
trunk/themis/modules/http/httpv4.cpp
Modified: trunk/themis/modules/http/httpv4.cpp
===================================================================
--- trunk/themis/modules/http/httpv4.cpp 2016-11-12 15:53:35 UTC (rev 734)
+++ trunk/themis/modules/http/httpv4.cpp 2017-01-15 12:03:24 UTC (rev 735)
@@ -890,17 +890,13 @@
}break;
case PlugInUnLoaded:
{
- PlugClass *plugin_object=NULL;
- msg->FindPointer("plugin",(void**)&plugin_object);
- if (plugin_object!=NULL)
+ int32 plugID;
+ msg->FindInt32("plugid", &plugID);
+ if (plugID == 'cash')
{
- if (plugin_object->PlugID()=='cash')
- {
- cache_user_token=0;
- CacheSystem=NULL;
- Debug("Cache System was just unloaded. I'm useless without it!");
-
- }
+ cache_user_token=0;
+ CacheSystem=NULL;
+ Debug("Cache System was just unloaded. I'm useless without it!");
}
status=B_OK;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-11-12 15:53:36
|
Revision: 734
http://sourceforge.net/p/themis/code/734
Author: mark_hellegers
Date: 2016-11-12 15:53:35 +0000 (Sat, 12 Nov 2016)
Log Message:
-----------
BHandlers don't respond to B_QUIT_REQUESTED. Need to delete them.
Got broken by my rewrite of the plugin manager a while back. Oops.
Modified Paths:
--------------
trunk/themis/common/plugman.cpp
Modified: trunk/themis/common/plugman.cpp
===================================================================
--- trunk/themis/common/plugman.cpp 2016-10-30 09:06:00 UTC (rev 733)
+++ trunk/themis/common/plugman.cpp 2016-11-12 15:53:35 UTC (rev 734)
@@ -227,9 +227,7 @@
if (aPlugin->IsHandler()) {
RemoveHandler(aPlugin->Handler());
- BMessenger messenger(aPlugin->Handler());
- // Use a synchronous message to quit. Don't care about the result?
- messenger.SendMessage(&quitMessage, &replyMessage);
+ delete aPlugin;
}
else if (aPlugin->IsLooper()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-10-30 09:06:03
|
Revision: 733
http://sourceforge.net/p/themis/code/733
Author: mark_hellegers
Date: 2016-10-30 09:06:00 +0000 (Sun, 30 Oct 2016)
Log Message:
-----------
Variable lock is not a pointer, so it is better to initialize it this way as the other way seemed to leak memory. Fixes build on Haiku as the copy constructor is now private
Modified Paths:
--------------
trunk/themis/common/cacheuser.cpp
Modified: trunk/themis/common/cacheuser.cpp
===================================================================
--- trunk/themis/common/cacheuser.cpp 2016-06-26 20:38:51 UTC (rev 732)
+++ trunk/themis/common/cacheuser.cpp 2016-10-30 09:06:00 UTC (rev 733)
@@ -30,7 +30,7 @@
#include <string.h>
#include <Autolock.h>
#include <stdio.h>
-CacheUser::CacheUser(uint32 broadcast_target,uint32 usertoken,const char *Name) {
+CacheUser::CacheUser(uint32 broadcast_target,uint32 usertoken,const char *Name) : lock(true) {
broadcast_id=broadcast_target;
if (Name!=NULL) {
name=new char[strlen(Name)+1];
@@ -42,7 +42,6 @@
// printf("\tCacheUser: %ld %p - %s\n",id,name,name);
next=prev=NULL;
readpos=writepos=0L;
- lock=new BLocker(true);
}
CacheUser::CacheUser(CacheUser *cu) {
@@ -76,7 +75,6 @@
delete name;
name=NULL;
}
-// delete lock;
}
uint32 CacheUser::BroadcastID() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-06-26 20:38:54
|
Revision: 732
http://sourceforge.net/p/themis/code/732
Author: mark_hellegers
Date: 2016-06-26 20:38:51 +0000 (Sun, 26 Jun 2016)
Log Message:
-----------
Be more resilient if no CSS file has been set yet in the preferences.
Modified Paths:
--------------
trunk/themis/modules/CSSParser/CSSParserPlugin.cpp
trunk/themis/modules/CSSParser/CSSParserPlugin.hpp
Modified: trunk/themis/modules/CSSParser/CSSParserPlugin.cpp
===================================================================
--- trunk/themis/modules/CSSParser/CSSParserPlugin.cpp 2016-05-02 20:23:12 UTC (rev 731)
+++ trunk/themis/modules/CSSParser/CSSParserPlugin.cpp 2016-06-26 20:38:51 UTC (rev 732)
@@ -219,9 +219,11 @@
int32 siteId = 0;
int32 urlId = 0;
int32 domId = 0;
- aOriginalMessage->FindInt32("site_id", &siteId);
- aOriginalMessage->FindInt32("url_id", &urlId);
- aOriginalMessage->FindInt32("dom_id", &domId);
+ if (aOriginalMessage != NULL) {
+ aOriginalMessage->FindInt32("site_id", &siteId);
+ aOriginalMessage->FindInt32("url_id", &urlId);
+ aOriginalMessage->FindInt32("dom_id", &domId);
+ }
/* Get an unique ID from the app for the DOM entry */
int32 cssId = ((App *)be_app)->GetNewID();
@@ -243,46 +245,51 @@
}
+void CSSParserPlugin :: LoadCSSFile(BMessage * aMessage) {
+
+ if (appSettings != NULL) {
+ BString path;
+ appSettings->FindString(kPrefsActiveCSSPath, &path);
+ if (path == NULL) {
+ // No path set, try to find the first css file and set it.
+ BString cssDir;
+ AppSettings->FindString(kPrefsSettingsDirectory, &cssDir);
+ cssDir.Append("/css/");
+
+ BDirectory dir(cssDir.String());
+ if(dir.InitCheck() != B_OK) {
+ printf("CSS directory (%s) not found!\n", cssDir.String());
+ printf("Setting CSSToUsePath to \"none\"\n");
+ AppSettings->AddString(kPrefsActiveCSSPath, kNoCSSFoundString);
+ }
+ else {
+ BEntry entry;
+ if (dir.GetNextEntry(&entry, false) != B_ENTRY_NOT_FOUND) {
+ BPath cssPath;
+ entry.GetPath(&cssPath);
+ path = cssPath.Path();
+ AppSettings->AddString(kPrefsActiveCSSPath, path);
+ }
+ }
+ }
+
+ if (path.String() != NULL) {
+ string cssLoad = "Loading new CSS file: ";
+ cssLoad += path.String();
+ Debug(cssLoad.c_str(), PlugID());
+ CSSStyleSheetPtr document = mParser->parse(path.String());
+ mDocuments.push_back(document);
+ NotifyParseFinished(document, "cssdom", aMessage);
+ }
+ }
+
+}
+
void CSSParserPlugin :: MessageReceived(BMessage * aMessage) {
switch (aMessage->what) {
case CSS_CHANGED_PARSER: {
- Debug("Request to change base css file", PlugID());
- if (appSettings != NULL) {
- BString path;
- appSettings->FindString(kPrefsActiveCSSPath, &path);
- if (path == NULL) {
- // No path set, try to find the first css file and set it.
- BString cssDir;
- AppSettings->FindString(kPrefsSettingsDirectory, &cssDir);
- cssDir.Append("/css/");
-
- BDirectory dir(cssDir.String());
- if(dir.InitCheck() != B_OK) {
- printf("CSS directory (%s) not found!\n", cssDir.String());
- printf("Setting CSSToUsePath to \"none\"\n");
- AppSettings->AddString(kPrefsActiveCSSPath, kNoCSSFoundString);
- }
- else {
- BEntry entry;
- if (dir.GetNextEntry(&entry, false) != B_ENTRY_NOT_FOUND) {
- BPath cssPath;
- entry.GetPath(&cssPath);
- path = cssPath.Path();
- AppSettings->AddString(kPrefsActiveCSSPath, path);
- }
- }
- }
-
- if (path.String() != NULL) {
- string cssLoad = "Loading new CSS file: ";
- cssLoad += path.String();
- Debug(cssLoad.c_str(), PlugID());
- CSSStyleSheetPtr document = mParser->parse(path.String());
- mDocuments.push_back(document);
- NotifyParseFinished(document, "cssdom", aMessage);
- }
- }
+ LoadCSSFile(aMessage);
break;
}
default: {
@@ -369,17 +376,7 @@
// Check if we already have the base css file loaded.
if (mDocuments.size() == 0) {
// Not loaded yet. Load it now.
- if (appSettings != NULL) {
- const char * path;
- appSettings->FindString(kPrefsActiveCSSPath, &path);
- string cssLoad = "Loading new CSS file: ";
- cssLoad += path;
- printf("%s\n", cssLoad.c_str());
- Debug(cssLoad.c_str(), PlugID());
- CSSStyleSheetPtr document = mParser->parse(path);
- mDocuments.push_back(document);
- NotifyParseFinished(document, "cssdom", aMessage);
- }
+ LoadCSSFile(aMessage);
}
else {
// Assuming the default stylesheet is parsed first!!!
Modified: trunk/themis/modules/CSSParser/CSSParserPlugin.hpp
===================================================================
--- trunk/themis/modules/CSSParser/CSSParserPlugin.hpp 2016-05-02 20:23:12 UTC (rev 731)
+++ trunk/themis/modules/CSSParser/CSSParserPlugin.hpp 2016-06-26 20:38:51 UTC (rev 732)
@@ -76,6 +76,8 @@
CSSParser * mParser;
// List of mimetypes supported.
vector<string> mMimeTypes;
+
+ void LoadCSSFile(BMessage * aMessage);
// Function to find out if a message was sent by the cache.
bool MessageSentByCache(BMessage * aMessage);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-05-02 20:23:14
|
Revision: 731
http://sourceforge.net/p/themis/code/731
Author: mark_hellegers
Date: 2016-05-02 20:23:12 +0000 (Mon, 02 May 2016)
Log Message:
-----------
Be a bit more resiliif no DTD has been set yet in thereferences.
Modified Paths:
--------------
trunk/themis/modules/HTMLParser/HTMLParser.cpp
Modified: trunk/themis/modules/HTMLParser/HTMLParser.cpp
===================================================================
--- trunk/themis/modules/HTMLParser/HTMLParser.cpp 2016-05-02 19:49:00 UTC (rev 730)
+++ trunk/themis/modules/HTMLParser/HTMLParser.cpp 2016-05-02 20:23:12 UTC (rev 731)
@@ -16,6 +16,7 @@
#include <Message.h>
#include <DataIO.h>
#include <storage/Directory.h>
+#include <storage/Path.h>
// HTMLParser headers
#include "HTMLParser.h"
@@ -41,6 +42,10 @@
BMessage ** appSettings_p;
BMessage * appSettings;
+// Constants used
+const char* const kPreferredDTD = "HTML.4.0.Transitional.DTD";
+
+
status_t Initialize(void * aInfo) {
parser = NULL;
@@ -168,13 +173,48 @@
string HTMLParser :: GetDTDPathFromSettings() const {
- const char * path = NULL;
+ string result = "";
+ const char * dtdPath = NULL;
if (appSettings != NULL) {
- appSettings->FindString(kPrefsActiveDTDPath, &path);
+ status_t found = appSettings->FindString(kPrefsActiveDTDPath, &dtdPath);
+ if (found != B_OK) {
+ // Not set yet, find one in the DTD directory.
+ BString dtdDir;
+ appSettings->FindString(kPrefsSettingsDirectory, &dtdDir);
+ dtdDir.Append("/dtd/");
+
+ BDirectory dir(dtdDir.String());
+ if(dir.InitCheck() != B_OK) {
+ printf("DTD directory (%s) not found!\n", dtdDir.String());
+ result = "";
+ }
+ else {
+ BEntry entry;
+ char name[B_FILE_NAME_LENGTH];
+ bool foundPreferredDTD = false;
+ while (dir.GetNextEntry(&entry, false) != B_ENTRY_NOT_FOUND && !foundPreferredDTD) {
+ BPath path;
+ entry.GetPath(&path);
+ entry.GetName(name);
+ BString dtd = name;
+ if (dtd.Compare(kPreferredDTD) == 0)
+ // This is our preferred DTD, use it.
+ foundPreferredDTD = true;
+ }
+ dtdDir.Append(name);
+ // Add it to the settings, so we don't have to do this the next time.
+ appSettings->AddString(kPrefsActiveDTDPath, dtdDir.String());
+ // Convert to a C++ string to return
+ result = dtdDir.String();
+ }
+ }
+ else {
+ result = dtdPath;
+ }
}
- return path;
+ return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-05-02 19:49:01
|
Revision: 730
http://sourceforge.net/p/themis/code/730
Author: mark_hellegers
Date: 2016-05-02 19:49:00 +0000 (Mon, 02 May 2016)
Log Message:
-----------
Make the BMenuFields in the preferences look a bit nicer
Modified Paths:
--------------
trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp
trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp
Modified: trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp
===================================================================
--- trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp 2016-03-05 16:43:45 UTC (rev 729)
+++ trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp 2016-05-02 19:49:00 UTC (rev 730)
@@ -117,6 +117,17 @@
rect.InsetBy(kItemSpacing, kItemSpacing);
rect.top += kBBoxExtraInset;
+#ifndef __HAIKU__
+ // ResizeToPreferred of a BMenuField is broken on BeOS,
+ // so we do something ourselves
+ font_height height;
+ GetFontHeight(&height);
+ // Set the menu height to the font height + a number of pixels
+ // around the text.
+ float menuHeight = height.ascent + height.descent + height.leading + 6;
+ rect.bottom = rect.top + menuHeight;
+#endif
+
BMenuField* cssmenufield = new BMenuField(
rect,
"CSSFIELD", "Cascading Style Sheet:",
@@ -124,6 +135,11 @@
true,
B_FOLLOW_TOP,
B_WILL_DRAW);
+#ifdef __HAIKU__
+ // We can use the normal way to resize the BMenuField to the right size
+ // on Haiku
+ cssmenufield->ResizeToPreferred();
+#endif
cssmenufield->SetDivider(be_plain_font->StringWidth("Cascading Style Sheet:") + kItemSpacing);
mMainBox->AddChild(cssmenufield);
Modified: trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp
===================================================================
--- trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp 2016-03-05 16:43:45 UTC (rev 729)
+++ trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp 2016-05-02 19:49:00 UTC (rev 730)
@@ -118,6 +118,17 @@
BRect rect = mMainBox->Bounds();
rect.InsetBy(kItemSpacing, kItemSpacing);
rect.top += kBBoxExtraInset;
+
+#ifndef __HAIKU__
+ // ResizeToPreferred of a BMenuField is broken on BeOS,
+ // so we do something ourselves
+ font_height height;
+ GetFontHeight(&height);
+ // Set the menu height to the font height + a number of pixels
+ // around the text.
+ float menuHeight = height.ascent + height.descent + height.leading + 6;
+ rect.bottom = rect.top + menuHeight;
+#endif
BMenuField* dtdmenufield = new BMenuField(
rect,
@@ -126,6 +137,12 @@
true,
B_FOLLOW_TOP,
B_WILL_DRAW);
+
+#ifdef __HAIKU__
+ // We can use the normal way to resize the BMenuField to the right size
+ // on Haiku
+ dtdmenufield->ResizeToPreferred();
+#endif
dtdmenufield->SetDivider(be_plain_font->StringWidth("Document Type Definition:") + kItemSpacing);
mMainBox->AddChild(dtdmenufield);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-03-05 16:43:47
|
Revision: 729
http://sourceforge.net/p/themis/code/729
Author: mark_hellegers
Date: 2016-03-05 16:43:45 +0000 (Sat, 05 Mar 2016)
Log Message:
-----------
Make Themis compile on recent versions of Haiku again.
Modified Paths:
--------------
trunk/themis/common/ColorTools.h
Modified: trunk/themis/common/ColorTools.h
===================================================================
--- trunk/themis/common/ColorTools.h 2016-03-05 16:27:49 UTC (rev 728)
+++ trunk/themis/common/ColorTools.h 2016-03-05 16:43:45 UTC (rev 729)
@@ -76,13 +76,13 @@
c.alpha = alpha;
return c;
}
-#endif
// Mix two colors together, ignoring their relative alpha channels.
// If amount is 0, the result is color1; if 255, the result is color2;
// if another value, it is somewhere in-between. The resulting alpha
// channel is mixed exactly like the other color channels.
rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount);
+#endif
// Blend two colors together, weighting by their relative alpha channels.
// The resulting color is the same as mix_color(), except that the amount
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2016-03-05 16:27:52
|
Revision: 728
http://sourceforge.net/p/themis/code/728
Author: mark_hellegers
Date: 2016-03-05 16:27:49 +0000 (Sat, 05 Mar 2016)
Log Message:
-----------
Implement horizontal scrolling in our own TOutlineListView (derived from BOutlineListView) and use that class where we were using BOutlineListView.
Modified Paths:
--------------
trunk/themis/makefile
trunk/themis/modules/CSSViewer/CSSView.cpp
trunk/themis/modules/CSSViewer/CSSView.hpp
trunk/themis/modules/DOMView/DOMView.cpp
trunk/themis/modules/DOMView/DOMView.h
Added Paths:
-----------
trunk/themis/common/TOutlineListView.cpp
trunk/themis/common/TOutlineListView.hpp
Added: trunk/themis/common/TOutlineListView.cpp
===================================================================
--- trunk/themis/common/TOutlineListView.cpp (rev 0)
+++ trunk/themis/common/TOutlineListView.cpp 2016-03-05 16:27:49 UTC (rev 728)
@@ -0,0 +1,85 @@
+/* TOutlineListView implementation
+ See TOutlineListView.hpp for more information
+*/
+
+// TOutlineListView header
+#include "TOutlineListView.hpp"
+
+// BeOS headers
+#include <ScrollView.h>
+
+TOutlineListView :: TOutlineListView(
+ BRect aFrame,
+ const char * aName,
+ list_view_type aType,
+ uint32 aResizingMode,
+ uint32 aFlags)
+ : BOutlineListView(
+ aFrame,
+ aName,
+ aType,
+ aResizingMode,
+ aFlags) {
+
+ fScroller = NULL;
+ fPrefWidth = 0;
+}
+
+TOutlineListView :: ~TOutlineListView() {
+
+}
+
+void TOutlineListView :: Draw(BRect aUpdateRect) {
+
+ BOutlineListView::Draw(aUpdateRect);
+
+ float prefWidth;
+ float prefHeight;
+ GetPreferredSize(&prefWidth, &prefHeight);
+
+ if (fPrefWidth != prefWidth) {
+ BRect rect = Bounds();
+ float proportion = 1;
+ if (rect.Width() < prefWidth) {
+ proportion = rect.Width() / prefWidth;
+ }
+
+ if (fScroller != NULL) {
+ BScrollBar * scrollBar = fScroller->ScrollBar(B_HORIZONTAL);
+ if (scrollBar != NULL) {
+ scrollBar->SetProportion(proportion);
+ scrollBar->SetRange(0, prefWidth - rect.Width());
+ }
+ }
+ fPrefWidth = prefWidth;
+ }
+
+}
+
+void TOutlineListView :: TargetedByScrollView(BScrollView * aScroller) {
+
+ BOutlineListView::TargetedByScrollView(aScroller);
+
+ fScroller = aScroller;
+
+}
+
+// Haiku's version of GetPreferredSize works fine
+#ifndef HAIKU
+
+void TOutlineListView :: GetPreferredSize(float * aWidth, float * aHeight) {
+
+ BOutlineListView::GetPreferredSize(aWidth, aHeight);
+
+ // Correct preferred width of BOutlineListView as BeOS calculates it wrong.
+ int32 count = CountItems();
+ float width = 0;
+ for (int32 i = 0; i < count; i++) {
+ width = ItemAt(i)->Width() + (ItemAt(i)->OutlineLevel() + 1) * be_plain_font->Size();
+ if (width > *aWidth)
+ *aWidth = width;
+ }
+
+}
+
+#endif
Added: trunk/themis/common/TOutlineListView.hpp
===================================================================
--- trunk/themis/common/TOutlineListView.hpp (rev 0)
+++ trunk/themis/common/TOutlineListView.hpp 2016-03-05 16:27:49 UTC (rev 728)
@@ -0,0 +1,44 @@
+/*
+ TOutlineListView
+ Same as a BOutlineListView, but properly sizes the horizontal scrollbar
+
+ Mark Hellegers (ma...@fi...)
+ 05-03-2016
+
+*/
+
+#ifndef TOUTLINELISTVIEW_HPP
+#define TOUTLINELISTVIEW_HPP
+
+// BeOS headers
+#include <OutlineListView.h>
+
+// Declarations used
+class BScrollView;
+
+class TOutlineListView : public BOutlineListView {
+
+ private:
+ BScrollView * fScroller;
+ float fPrefWidth;
+
+ public:
+ TOutlineListView(
+ BRect aFrame,
+ const char * aName,
+ list_view_type aType = B_SINGLE_SELECTION_LIST,
+ uint32 aResizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
+ uint32 aFlags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
+ virtual ~TOutlineListView();
+
+ virtual void Draw(BRect aUpdateRect);
+ virtual void TargetedByScrollView(BScrollView * aScroller);
+
+// Haiku's version of GetPreferredSize works fine
+#ifndef HAIKU
+ virtual void GetPreferredSize(float * aWidth, float * aHeight);
+#endif
+
+};
+
+#endif
Modified: trunk/themis/makefile
===================================================================
--- trunk/themis/makefile 2015-06-07 00:06:48 UTC (rev 727)
+++ trunk/themis/makefile 2016-03-05 16:27:49 UTC (rev 728)
@@ -107,7 +107,8 @@
common/CSSDOMEntry.cpp \
common/ColumnListView.cpp \
common/ColumnTypes.cpp \
- common/ColorTools.cpp
+ common/ColorTools.cpp \
+ common/TOutlineListView.cpp
#add similar lines for new plugins, libraries, etc.
HTTPADDONSOURCES= \
http/optionshandler.cpp \
Modified: trunk/themis/modules/CSSViewer/CSSView.cpp
===================================================================
--- trunk/themis/modules/CSSViewer/CSSView.cpp 2015-06-07 00:06:48 UTC (rev 727)
+++ trunk/themis/modules/CSSViewer/CSSView.cpp 2016-03-05 16:27:49 UTC (rev 728)
@@ -58,6 +58,7 @@
#include "ColumnListView.h"
#include "ColumnTypes.h"
#include "TTextView.hpp"
+#include "TOutlineListView.hpp"
// Constants used
@@ -87,7 +88,7 @@
treeRect.bottom -= B_H_SCROLL_BAR_HEIGHT;
treeRect.right -= 350;
treeRect.right -= B_V_SCROLL_BAR_WIDTH;
- mTree = new BOutlineListView(treeRect,
+ mTree = new TOutlineListView(treeRect,
"CSSView",
B_SINGLE_SELECTION_LIST,
B_FOLLOW_ALL_SIDES);
Modified: trunk/themis/modules/CSSViewer/CSSView.hpp
===================================================================
--- trunk/themis/modules/CSSViewer/CSSView.hpp 2015-06-07 00:06:48 UTC (rev 727)
+++ trunk/themis/modules/CSSViewer/CSSView.hpp 2016-03-05 16:27:49 UTC (rev 728)
@@ -38,7 +38,6 @@
#include <SupportDefs.h>
#include <Handler.h>
#include <Window.h>
-#include <OutlineListView.h>
// DOM Style headers
#include "CSSStyleSheet.hpp"
@@ -46,11 +45,12 @@
// Declarations of Themis classes
class TTextView;
class BColumnListView;
+class TOutlineListView;
class CSSView : public BWindow {
private:
- BOutlineListView * mTree;
+ TOutlineListView * mTree;
CSSStyleSheetPtr mStyleSheet;
BStringItem * mMediaItem;
BStringItem * mGeneralItem;
Modified: trunk/themis/modules/DOMView/DOMView.cpp
===================================================================
--- trunk/themis/modules/DOMView/DOMView.cpp 2015-06-07 00:06:48 UTC (rev 727)
+++ trunk/themis/modules/DOMView/DOMView.cpp 2016-03-05 16:27:49 UTC (rev 728)
@@ -55,6 +55,7 @@
// Themis headers
#include "TTextView.hpp"
+#include "TOutlineListView.hpp"
DOMView :: DOMView(TDocumentPtr aDocument)
: BWindow(BRect(100, 100, 450, 400),
@@ -76,7 +77,7 @@
treeRect.bottom -= B_H_SCROLL_BAR_HEIGHT;
treeRect.right -= 200;
treeRect.right -= B_V_SCROLL_BAR_WIDTH;
- mTree = new BOutlineListView(treeRect,
+ mTree = new TOutlineListView(treeRect,
"DOMView",
B_SINGLE_SELECTION_LIST,
B_FOLLOW_ALL_SIDES);
Modified: trunk/themis/modules/DOMView/DOMView.h
===================================================================
--- trunk/themis/modules/DOMView/DOMView.h 2015-06-07 00:06:48 UTC (rev 727)
+++ trunk/themis/modules/DOMView/DOMView.h 2016-03-05 16:27:49 UTC (rev 728)
@@ -38,7 +38,6 @@
#include <SupportDefs.h>
#include <Handler.h>
#include <Window.h>
-#include <OutlineListView.h>
#include <ListView.h>
#include <PopUpMenu.h>
@@ -50,6 +49,7 @@
// Declarations of Themis classes
class TTextView;
+class TOutlineListView;
// Namespaces used
using namespace std;
@@ -61,7 +61,7 @@
class DOMView : public BWindow {
private:
- BOutlineListView * mTree;
+ TOutlineListView * mTree;
BListView * mAttributes;
BListView * mValues;
BPopUpMenu * mTextMenu;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-06-07 00:06:50
|
Revision: 727
http://sourceforge.net/p/themis/code/727
Author: mark_hellegers
Date: 2015-06-07 00:06:48 +0000 (Sun, 07 Jun 2015)
Log Message:
-----------
Moving table files to common caused a crash in the css viewer addon on BeOS, while it worked fine on Haiku.
Left files in common, but explicitly compiling code from those files in css viewer addon.
Might be a compiler issue...
Modified Paths:
--------------
trunk/themis/makefile
Modified: trunk/themis/makefile
===================================================================
--- trunk/themis/makefile 2015-06-06 22:09:56 UTC (rev 726)
+++ trunk/themis/makefile 2015-06-07 00:06:48 UTC (rev 727)
@@ -756,9 +756,9 @@
#cssviewer add-on
cssvaddon: framework $(BASE_ADDON_INSTALL_DIR)css_viewer.so domlib
-$(BASE_ADDON_INSTALL_DIR)css_viewer.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(CSSVIEWERSOURCES),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(notdir $(file:.cpp=.o)))
+$(BASE_ADDON_INSTALL_DIR)css_viewer.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(CSSVIEWERSOURCES),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(notdir $(file:.cpp=.o))) common/ColorTools.cpp common/ColumnListView.cpp common/ColumnTypes.cpp
@echo "Linking CSS Viewer add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_viewer.so $(foreach file,$(notdir $(CSSVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_viewer.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldomstyle -ldom -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_viewer.so $(foreach file,$(notdir $(CSSVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(file)) $(COMMON_OBJECT_DIR)ColorTools.o $(COMMON_OBJECT_DIR)ColumnListView.o $(COMMON_OBJECT_DIR)ColumnTypes.o -nostart -Xlinker $(LDFLAGS) -soname=css_viewer.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldomstyle -ldom -lstdc++.r4 _APP_
@echo "CSS Viewer add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)css_viewer.so
@echo "CSS Viewer plug-in compiled and linked successfully."
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-06-06 22:09:59
|
Revision: 726
http://sourceforge.net/p/themis/code/726
Author: mark_hellegers
Date: 2015-06-06 22:09:56 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
Move table code to common directory, so it can be reused.
Modified Paths:
--------------
trunk/themis/makefile
Added Paths:
-----------
trunk/themis/common/ColorTools.cpp
trunk/themis/common/ColorTools.h
trunk/themis/common/ColumnListView.cpp
trunk/themis/common/ColumnListView.h
trunk/themis/common/ColumnTypes.cpp
trunk/themis/common/ColumnTypes.h
trunk/themis/common/ObjectList.h
Removed Paths:
-------------
trunk/themis/modules/CSSViewer/ColorTools.cpp
trunk/themis/modules/CSSViewer/ColorTools.h
trunk/themis/modules/CSSViewer/ColumnListView.cpp
trunk/themis/modules/CSSViewer/ColumnListView.h
trunk/themis/modules/CSSViewer/ColumnTypes.cpp
trunk/themis/modules/CSSViewer/ColumnTypes.h
trunk/themis/modules/CSSViewer/ObjectList.h
Copied: trunk/themis/common/ColorTools.cpp (from rev 719, trunk/themis/modules/CSSViewer/ColorTools.cpp)
===================================================================
--- trunk/themis/common/ColorTools.cpp (rev 0)
+++ trunk/themis/common/ColorTools.cpp 2015-06-06 22:09:56 UTC (rev 726)
@@ -0,0 +1,110 @@
+/*
+Open Tracker License
+
+Terms and Conditions
+
+Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice applies to all licensees
+and shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Be Incorporated shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization from Be Incorporated.
+
+Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
+of Be Incorporated in the United States and other countries. Other brand product
+names are registered trademarks or trademarks of their respective holders.
+All rights reserved.
+*/
+
+/*******************************************************************************
+/
+/ File: ColorTools.cpp
+/
+/ Description: Additional experimental color manipulation functions.
+/
+/ Copyright 2000, Be Incorporated, All Rights Reserved
+/
+*******************************************************************************/
+
+#include "ColorTools.h"
+
+#if B_BEOS_VERSION <= B_BEOS_VERSION_MAUI
+
+namespace BExperimental {
+
+#if DEBUG
+#define DB_INLINE
+#else
+#define DB_INLINE inline
+#endif
+
+static DB_INLINE void mix_color_func(rgb_color* target, const rgb_color other, uint8 amount)
+{
+ target->red = (uint8)( ((int16(other.red)-int16(target->red))*amount)/255
+ + target->red );
+ target->green = (uint8)( ((int16(other.green)-int16(target->green))*amount)/255
+ + target->green );
+ target->blue = (uint8)( ((int16(other.blue)-int16(target->blue))*amount)/255
+ + target->blue );
+ target->alpha = (uint8)( ((int16(other.alpha)-int16(target->alpha))*amount)/255
+ + target->alpha );
+}
+
+static DB_INLINE void blend_color_func(rgb_color* target, const rgb_color other, uint8 amount)
+{
+ const uint8 alphaMix = (uint8)( ((int16(other.alpha)-int16(255-target->alpha))*amount)/255
+ + (255-target->alpha) );
+ target->red = (uint8)( ((int16(other.red)-int16(target->red))*alphaMix)/255
+ + target->red );
+ target->green = (uint8)( ((int16(other.green)-int16(target->green))*alphaMix)/255
+ + target->green );
+ target->blue = (uint8)( ((int16(other.blue)-int16(target->blue))*alphaMix)/255
+ + target->blue );
+ target->alpha = (uint8)( ((int16(other.alpha)-int16(target->alpha))*amount)/255
+ + target->alpha );
+}
+
+static DB_INLINE void disable_color_func(rgb_color* target, const rgb_color background)
+{
+ blend_color_func(target, background, 255-70);
+}
+
+// --------------------------------------------------------------------------
+
+rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount)
+{
+ mix_color_func(&color1, color2, amount);
+ return color1;
+}
+
+rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount)
+{
+ blend_color_func(&color1, color2, amount);
+ return color1;
+}
+
+rgb_color disable_color(rgb_color color, rgb_color background)
+{
+ disable_color_func(&color, background);
+ return color;
+}
+
+}
+
+#endif
Copied: trunk/themis/common/ColorTools.h (from rev 719, trunk/themis/modules/CSSViewer/ColorTools.h)
===================================================================
--- trunk/themis/common/ColorTools.h (rev 0)
+++ trunk/themis/common/ColorTools.h 2015-06-06 22:09:56 UTC (rev 726)
@@ -0,0 +1,105 @@
+/*
+Open Tracker License
+
+Terms and Conditions
+
+Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice applies to all licensees
+and shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Be Incorporated shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization from Be Incorporated.
+
+Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
+of Be Incorporated in the United States and other countries. Other brand product
+names are registered trademarks or trademarks of their respective holders.
+All rights reserved.
+*/
+
+/*******************************************************************************
+/
+/ File: ColorTools.h
+/
+/ Description: Additional experimental color manipulation functions.
+/
+/ Copyright 2000, Be Incorporated, All Rights Reserved
+/
+*******************************************************************************/
+
+
+#ifndef _COLOR_TOOLS_H
+#define _COLOR_TOOLS_H
+
+#include <GraphicsDefs.h>
+
+#if B_BEOS_VERSION <= B_BEOS_VERSION_5
+
+namespace BExperimental {
+
+// Comparison operators.
+
+inline bool operator==(const rgb_color c1, const rgb_color c2)
+{
+ return (*((uint32*)&c1)) == (*((uint32*)&c2));
+}
+
+inline bool operator!=(const rgb_color c1, const rgb_color c2)
+{
+ return (*((uint32*)&c1)) != (*((uint32*)&c2));
+}
+
+#ifndef __HAIKU__
+// Color creation.
+
+inline rgb_color make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha=255)
+{
+ rgb_color c;
+ c.red = red;
+ c.green = green;
+ c.blue = blue;
+ c.alpha = alpha;
+ return c;
+}
+#endif
+
+// Mix two colors together, ignoring their relative alpha channels.
+// If amount is 0, the result is color1; if 255, the result is color2;
+// if another value, it is somewhere in-between. The resulting alpha
+// channel is mixed exactly like the other color channels.
+rgb_color mix_color(rgb_color color1, rgb_color color2, uint8 amount);
+
+// Blend two colors together, weighting by their relative alpha channels.
+// The resulting color is the same as mix_color(), except that the amount
+// used from color1 and color2's color channels is dependent on that color's
+// alpha channel. For example, if color1.alpha is 0 and color2.alpha is
+// 255, the resulting red, green, and blue values will be the same as those
+// in color2, regardless of 'amount'.
+rgb_color blend_color(rgb_color color1, rgb_color color2, uint8 amount);
+
+// Return a color that is the disabled representation of 'color' when drawn
+// on a solid color 'background'.
+rgb_color disable_color(rgb_color color, rgb_color background);
+
+} // namespace BExperimental
+
+using namespace BExperimental;
+
+#endif
+
+#endif
Copied: trunk/themis/common/ColumnListView.cpp (from rev 719, trunk/themis/modules/CSSViewer/ColumnListView.cpp)
===================================================================
--- trunk/themis/common/ColumnListView.cpp (rev 0)
+++ trunk/themis/common/ColumnListView.cpp 2015-06-06 22:09:56 UTC (rev 726)
@@ -0,0 +1,4196 @@
+/*
+Open Tracker License
+
+Terms and Conditions
+
+Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice applies to all licensees
+and shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Be Incorporated shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization from Be Incorporated.
+
+Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
+of Be Incorporated in the United States and other countries. Other brand product
+names are registered trademarks or trademarks of their respective holders.
+All rights reserved.
+*/
+
+/*******************************************************************************
+/
+/ File: ColumnListView.cpp
+/
+/ Description: Experimental multi-column list view.
+/
+/ Copyright 2000+, Be Incorporated, All Rights Reserved
+/ By Jeff Bush
+/
+*******************************************************************************/
+
+#include <typeinfo>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <Application.h>
+#include <Bitmap.h>
+#if _INCLUDES_CLASS_CURSOR
+#include <Cursor.h>
+#endif
+#include <Debug.h>
+#include <GraphicsDefs.h>
+#include <MenuItem.h>
+#include <PopUpMenu.h>
+#include <Region.h>
+#include <ScrollBar.h>
+#include <String.h>
+#include <Window.h>
+
+#include "ObjectList.h"
+#include "ColumnListView.h"
+#include "ColorTools.h"
+/*
+#ifndef _ARCHIVE_DEFS_H
+#include <archive_defs.h>
+#endif
+*/
+#define DOUBLE_BUFFERED_COLUMN_RESIZE 1
+#define SMART_REDRAW 1
+#define DRAG_TITLE_OUTLINE 1
+#define CONSTRAIN_CLIPPING_REGION 1
+#define LOWER_SCROLLBAR 1
+
+namespace BPrivate {
+
+static const unsigned char kResizeCursorData[] = {
+ 16, 1, 8, 8,
+ 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 9, 0x90, 0x19, 0x98, 0x39, 0x09c, 0x79, 0x9e,
+ 0x79, 0x9e, 0x39, 0x9c, 0x19, 0x98, 0x9, 0x90, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0,
+ 3, 0xc0, 3, 0xc0, 3, 0xc0, 0xf, 0xf0, 0x1f, 0xf8, 0x3f, 0xfa, 0x7f, 0xfe, 0xff, 0xff,
+ 0xff, 0xff, 0x7f, 0xfe, 0x3f, 0xfa, 0x1f, 0xf8, 0xf, 0xf0, 3, 0xc0, 3, 0xc0, 3, 0xc0
+};
+
+static const unsigned char kMaxResizeCursorData[] = {
+ 16, 1, 8, 8,
+ 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 9, 0x80, 0x19, 0x80, 0x39, 0x80, 0x79, 0x80,
+ 0x79, 0x80, 0x39, 0x80, 0x19, 0x80, 0x9, 0x80, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0,
+ 3, 0xc0, 3, 0xc0, 3, 0xc0, 0xf, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xc0, 0xff, 0xc0,
+ 0xff, 0xc0, 0x7f, 0xc0, 0x3f, 0xc0, 0x1f, 0xc0, 0xf, 0xc0, 3, 0xc0, 3, 0xc0, 3, 0xc0
+};
+
+static const unsigned char kMinResizeCursorData[] = {
+ 16, 1, 8, 8,
+ 0, 0, 1, 0x80, 1, 0x80, 1, 0x80, 1, 0x90, 1, 0x98, 1, 0x09c, 1, 0x9e,
+ 1, 0x9e, 1, 0x9c, 1, 0x98, 1, 0x90, 1, 0x80, 1, 0x80, 1, 0x80, 0, 0,
+ 3, 0xc0, 3, 0xc0, 3, 0xc0, 3, 0xf0, 3, 0xf8, 3, 0xfa, 3, 0xfe, 3, 0xff,
+ 3, 0xff, 3, 0xfe, 3, 0xfa, 3, 0xf8, 3, 0xf0, 3, 0xc0, 3, 0xc0, 3, 0xc0
+};
+
+static const unsigned char kColumnMoveCursorData[] = {
+ 16, 1, 8, 8,
+ 1, 0x80, 3, 0xc0, 7, 0xe0, 0, 0, 0, 0, 0x20, 4, 0x61, 0x86, 0xe3, 0xc7,
+ 0xe3, 0xc7, 0x61, 0x86, 0x20, 4, 0, 0, 0, 0, 7, 0xe0, 3, 0xc0, 1, 0x80,
+ 1, 0x80, 3, 0xc0, 7, 0xe0, 0, 0, 0, 0, 0x20, 4, 0x61, 0x86, 0xe3, 0xc7,
+ 0xe3, 0xc7, 0x61, 0x86, 0x20, 4, 0, 0, 0, 0, 7, 0xe0, 3, 0xc0, 1, 0x80
+};
+
+static const unsigned char kUpSortArrow8x8[] = {
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff
+};
+
+static const unsigned char kDownSortArrow8x8[] = {
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff
+};
+
+static const unsigned char kUpSortArrow8x8Invert[] = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff
+};
+
+static const unsigned char kDownSortArrow8x8Invert[] = {
+ 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+/*
+static const rgb_color kTitleColor = {215, 215, 215, 255};
+static const rgb_color kTitleTextColor = { 0, 0, 0, 255 };
+static const rgb_color kDefaultBackgroundColor = {236, 236, 236, 255};
+static const rgb_color kRowDividerColor = {148, 148, 148, 255};
+static const rgb_color kDefaultSelectionColor = {255, 255, 255, 255};
+static const rgb_color kDefaultEditColor = {180, 180, 180, 180};
+static const rgb_color kNonFocusSelectionColor = {220, 220, 220, 255};
+*/
+
+static const float kTitleHeight = 17.0;
+static const float kLatchWidth = 15.0;
+
+
+static const rgb_color kColor[B_COLOR_TOTAL] =
+{
+ {236, 236, 236, 255}, // B_COLOR_BACKGROUND
+ { 0, 0, 0, 255}, // B_COLOR_TEXT
+ {148, 148, 148, 255}, // B_COLOR_ROW_DIVIDER
+ {255, 255, 255, 255}, // B_COLOR_SELECTION
+ { 0, 0, 0, 255}, // B_COLOR_SELECTION_TEXT
+ {220, 220, 220, 255}, // B_COLOR_NON_FOCUS_SELECTION
+ {180, 180, 180, 180}, // B_COLOR_EDIT_BACKGROUND
+ { 0, 0, 0, 255}, // B_COLOR_EDIT_TEXT
+ {215, 215, 215, 255}, // B_COLOR_HEADER_BACKGROUND
+ { 0, 0, 0, 255}, // B_COLOR_HEADER_TEXT
+ { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_LINE
+ { 0, 0, 0, 255}, // B_COLOR_SEPARATOR_BORDER
+};
+
+static const int32 kMaxDepth = 1024;
+static const float kLeftMargin = kLatchWidth;
+static const float kRightMargin = kLatchWidth;
+static const float kBottomMargin = kLatchWidth;
+static const float kOutlineLevelIndent = kLatchWidth;
+static const float kColumnResizeAreaWidth = 10.0;
+static const float kRowDragSensitivity = 5.0;
+static const float kDoubleClickMoveSensitivity = 4.0;
+static const float kSortIndicatorWidth = 9.0;
+static const float kDropHighlightLineHeight = 2.0;
+
+static const uint32 kToggleColumn = 'BTCL';
+
+class BRowContainer : public BObjectList<BRow>
+{
+};
+
+class TitleView : public BView {
+public:
+ TitleView(BRect, OutlineView*, BList *visibleColumns, BList *sortColumns,
+ BColumnListView *masterView, uint32 resizingMode);
+ ~TitleView();
+ void ColumnAdded(BColumn*);
+ void SetColumnVisible(BColumn*, bool);
+
+ virtual void Draw(BRect rect);
+ virtual void ScrollTo(BPoint);
+ virtual void MessageReceived(BMessage*);
+ virtual void MouseDown(BPoint);
+ virtual void MouseMoved(BPoint, uint32, const BMessage*);
+ virtual void MouseUp(BPoint position);
+ virtual void FrameResized(float width, float height);
+
+ void MoveColumn(BColumn *column, int32 index);
+ void SetColumnFlags(column_flags flags);
+
+ void SetEditMode(bool state) { fEditMode = state; }
+
+private:
+ void GetTitleRect(BColumn*, BRect *out_rect);
+ int32 FindColumn(BPoint, float *out_leftEdge);
+ void FixScrollBar(bool scrollToFit);
+ void DragSelectedColumn(BPoint);
+ void ResizeSelectedColumn(BPoint);
+ void ComputeDragBoundries(BColumn*, BPoint);
+ void DrawTitle(BView*, BRect, BColumn*, bool depressed);
+
+ OutlineView *fOutlineView;
+ BList *fColumns;
+ BList *fSortColumns;
+ float fColumnsWidth;
+ BRect fVisibleRect;
+
+#if DOUBLE_BUFFERED_COLUMN_RESIZE
+ BBitmap *fDrawBuffer;
+ BView *fDrawBufferView;
+#endif
+
+ enum {
+ INACTIVE,
+ RESIZING_COLUMN,
+ PRESSING_COLUMN,
+ DRAG_COLUMN_INSIDE_TITLE,
+ DRAG_COLUMN_OUTSIDE_TITLE
+ } fCurrentState;
+
+ BPopUpMenu *fColumnPop;
+ BColumnListView *fMasterView;
+ bool fEditMode;
+ int32 fColumnFlags;
+
+ // State information for resizing/dragging
+ BColumn *fSelectedColumn;
+ BRect fSelectedColumnRect;
+ bool fResizingFirstColumn;
+ BPoint fClickPoint; // offset within cell
+ float fLeftDragBoundry;
+ float fRightDragBoundry;
+ BPoint fCurrentDragPosition;
+
+
+ BBitmap *fUpSortArrow;
+ BBitmap *fDownSortArrow;
+#if _INCLUDES_CLASS_CURSOR
+ BCursor *fResizeCursor;
+ BCursor *fMinResizeCursor;
+ BCursor *fMaxResizeCursor;
+ BCursor *fColumnMoveCursor;
+#endif
+
+
+ typedef BView _inherited;
+};
+
+class OutlineView : public BView {
+public:
+ OutlineView(BRect, BList *visibleColumns, BList *sortColumns, BColumnListView *listView);
+ ~OutlineView();
+
+ virtual void Draw(BRect);
+ const BRect& VisibleRect() const;
+
+ void RedrawColumn(BColumn *column, float leftEdge, bool isFirstColumn);
+ void StartSorting();
+
+ void AddRow(BRow*, int32 index, BRow *TheRow);
+ BRow* CurrentSelection(BRow *lastSelected) const;
+ void ToggleFocusRowSelection(bool selectRange);
+ void ToggleFocusRowOpen();
+ void ChangeFocusRow(bool up, bool updateSelection, bool addToCurrentSelection);
+ void MoveFocusToVisibleRect();
+ void ExpandOrCollapse(BRow *parent, bool expand);
+ void RemoveRow(BRow*);
+ BRowContainer* RowList();
+ void UpdateRow(BRow*);
+ bool FindParent(BRow *row, BRow **out_parent, bool *out_isVisible);
+ int32 IndexOf(BRow *row);
+ void Deselect(BRow*);
+ void AddToSelection(BRow*);
+ void DeselectAll();
+ BRow* FocusRow() const;
+ void SetFocusRow(BRow *row, bool select);
+ BRow* FindRow(float ypos, int32 *out_indent, float *out_top);
+ bool FindRect(const BRow *row, BRect *out_rect);
+ void ScrollTo(const BRow* Row);
+
+ void Clear();
+ void SetSelectionMode(list_view_type);
+ list_view_type SelectionMode() const;
+ void SetMouseTrackingEnabled(bool);
+ void FixScrollBar(bool scrollToFit);
+ void SetEditMode(bool state) { fEditMode = state; }
+
+ virtual void FrameResized(float width, float height);
+ virtual void ScrollTo(BPoint pt);
+ virtual void MouseDown(BPoint);
+ virtual void MouseMoved(BPoint, uint32, const BMessage*);
+ virtual void MouseUp(BPoint);
+ virtual void MessageReceived(BMessage*);
+
+private:
+ bool SortList(BRowContainer *list, bool isVisible);
+ static int32 DeepSortThreadEntry(void *outlineView);
+ void DeepSort();
+ void SelectRange(BRow *start, BRow *end);
+ int32 CompareRows(BRow *row1, BRow *row2);
+ void AddSorted(BRowContainer *list, BRow *row);
+ void RecursiveDeleteRows(BRowContainer *list, bool owner);
+ void InvalidateCachedPositions();
+ bool FindVisibleRect(BRow *row, BRect *out_rect);
+
+ BList* fColumns;
+ BList* fSortColumns;
+ float fItemsHeight;
+ BRowContainer fRows;
+ BRect fVisibleRect;
+
+#if DOUBLE_BUFFERED_COLUMN_RESIZE
+ BBitmap* fDrawBuffer;
+ BView* fDrawBufferView;
+#endif
+
+ BRow* fFocusRow;
+ BRect fFocusRowRect;
+ BRow* fRollOverRow;
+
+ BRow fSelectionListDummyHead;
+ BRow* fLastSelectedItem;
+ BRow* fFirstSelectedItem;
+
+ thread_id fSortThread;
+ int32 fNumSorted;
+ bool fSortCancelled;
+
+ enum CurrentState
+ {
+ INACTIVE,
+ LATCH_CLICKED,
+ ROW_CLICKED,
+ DRAGGING_ROWS
+ };
+
+ CurrentState fCurrentState;
+
+
+ BColumnListView* fMasterView;
+ list_view_type fSelectionMode;
+ bool fTrackMouse;
+ BField* fCurrentField;
+ BRow* fCurrentRow;
+ BColumn* fCurrentColumn;
+ bool fMouseDown;
+ BRect fFieldRect;
+ int32 fCurrentCode;
+ bool fEditMode;
+
+ // State information for mouse/keyboard interaction
+ BPoint fClickPoint;
+ bool fDragging;
+ int32 fClickCount;
+ BRow *fTargetRow;
+ float fTargetRowTop;
+ BRect fLatchRect;
+ float fDropHighlightY;
+
+ friend class RecursiveOutlineIterator;
+ typedef BView _inherited;
+};
+
+class RecursiveOutlineIterator {
+public:
+ RecursiveOutlineIterator(BRowContainer*, bool openBranchesOnly = true);
+ BRow *CurrentRow() const;
+ int32 CurrentLevel() const;
+ void GoToNext();
+
+private:
+ struct {
+ BRowContainer *fRowSet;
+ int32 fIndex;
+ int32 fDepth;
+ } fStack[kMaxDepth];
+
+ int32 fStackIndex;
+ BRowContainer *fCurrentList;
+ int32 fCurrentListIndex;
+ int32 fCurrentListDepth;
+ bool fOpenBranchesOnly;
+};
+
+} // namespace BPrivate
+
+using namespace BPrivate;
+
+BField::BField()
+{
+}
+
+BField::~BField()
+{
+}
+
+// #pragma mark -
+
+void BColumn::MouseMoved(BColumnListView */*parent*/, BRow */*row*/, BField */*field*/,
+ BRect /*field_rect*/, BPoint/*point*/, uint32 /*buttons*/, int32 /*code*/)
+{
+}
+
+void BColumn::MouseDown( BColumnListView */*parent*/, BRow */*row*/, BField */*field*/,
+ BRect /*field_rect*/, BPoint /*point*/, uint32 /*buttons*/)
+{
+}
+
+void BColumn::MouseUp(BColumnListView */*parent*/, BRow */*row*/, BField */*field*/)
+{
+}
+
+// #pragma mark -
+
+BRow::BRow(float height)
+ : fChildList(NULL),
+ fIsExpanded(false),
+ fHeight(height),
+ fNextSelected(NULL),
+ fPrevSelected(NULL),
+ fParent(NULL),
+ fList(NULL)
+{
+}
+
+BRow::~BRow()
+{
+ while (true) {
+ BField *field = (BField*) fFields.RemoveItem(0L);
+ if (field == 0)
+ break;
+
+ delete field;
+ }
+}
+
+bool BRow::HasLatch() const
+{
+ return fChildList != 0;
+}
+
+int32 BRow::CountFields() const
+{
+ return fFields.CountItems();
+}
+
+BField* BRow::GetField(int32 index)
+{
+ return (BField*) fFields.ItemAt(index);
+}
+
+const BField* BRow::GetField(int32 index) const
+{
+ return (const BField*) fFields.ItemAt(index);
+}
+
+void BRow::SetField(BField *field, int32 logicalFieldIndex)
+{
+ if (fFields.ItemAt(logicalFieldIndex) != 0)
+ delete (BField*) fFields.RemoveItem(logicalFieldIndex);
+
+ if( NULL != fList ) {
+ ValidateField(field, logicalFieldIndex);
+ BRect inv;
+ fList->GetRowRect(this, &inv);
+ fList->Invalidate(inv);
+ }
+
+ fFields.AddItem(field, logicalFieldIndex);
+}
+
+float BRow::Height() const
+{
+ return fHeight;
+}
+
+bool BRow::IsExpanded() const
+{
+ return fIsExpanded;
+}
+
+void
+BRow::ValidateFields() const
+{
+ for( int32 i = 0; i < CountFields(); i++ )
+ {
+ ValidateField(GetField(i), i);
+ }
+}
+
+void
+BRow::ValidateField(const BField *field, int32 logicalFieldIndex) const
+{
+ // The Fields may be moved by the user, but the logicalFieldIndexes
+ // do not change, so we need to map them over when checking the
+ // Field types.
+ BColumn* col = NULL;
+ int32 items = fList->CountColumns();
+ for( int32 i = 0 ; i < items; ++i )
+ {
+ col = fList->ColumnAt(i);
+ if( col->LogicalFieldNum() == logicalFieldIndex )
+ break;
+ }
+
+ if( NULL == col )
+ {
+ BString dbmessage("\n\n\tThe parent BColumnListView does not have "
+ "\n\ta BColumn at the logical field index ");
+ dbmessage << logicalFieldIndex << ".\n\n";
+ printf(dbmessage.String());
+ }
+ else
+ {
+ if( false == col->AcceptsField(field) )
+ {
+ BString dbmessage("\n\n\tThe BColumn of type ");
+ dbmessage << typeid(*col).name() << "\n\tat logical field index "
+ << logicalFieldIndex << "\n\tdoes not support the field type "
+ << typeid(*field).name() << ".\n\n";
+ debugger(dbmessage.String());
+ }
+ }
+}
+
+
+// #pragma mark -
+
+BColumn::BColumn(float width, float minWidth, float maxWidth, alignment align)
+ : fWidth(width),
+ fMinWidth(minWidth),
+ fMaxWidth(maxWidth),
+ fVisible(true),
+ fList(0),
+ fShowHeading(true),
+ fAlignment(align)
+{
+}
+
+BColumn::~BColumn()
+{
+}
+
+float BColumn::Width() const
+{
+ return fWidth;
+}
+
+void BColumn::SetWidth(float width)
+{
+ fWidth = width;
+}
+
+float BColumn::MinWidth() const
+{
+ return fMinWidth;
+}
+
+float BColumn::MaxWidth() const
+{
+ return fMaxWidth;
+}
+
+void BColumn::DrawTitle(BRect, BView*)
+{
+}
+
+void BColumn::DrawField(BField*, BRect, BView*)
+{
+}
+
+int BColumn::CompareFields(BField *, BField *)
+{
+ return 0;
+}
+
+void BColumn::GetColumnName(BString* into) const
+{
+ *into = "(Unnamed)";
+}
+
+float BColumn::GetPreferredWidth(BField *field, BView *parent) const
+{
+ return 0;
+}
+
+bool BColumn::IsVisible() const
+{
+ return fVisible;
+}
+
+void BColumn::SetVisible(bool visible)
+{
+ if (fList && (fVisible != visible))
+ fList->SetColumnVisible(this, visible);
+}
+
+bool BColumn::ShowHeading() const
+{
+ return fShowHeading;
+}
+
+void BColumn::SetShowHeading(bool state)
+{
+ fShowHeading = state;
+}
+
+alignment BColumn::Alignment() const
+{
+ return fAlignment;
+}
+
+void BColumn::SetAlignment(alignment align)
+{
+ fAlignment = align;
+}
+
+bool BColumn::WantsEvents() const
+{
+ return fWantsEvents;
+}
+
+void BColumn::SetWantsEvents(bool state)
+{
+ fWantsEvents = state;
+}
+
+int32 BColumn::LogicalFieldNum() const
+{
+ return fFieldID;
+}
+
+bool
+BColumn::AcceptsField(const BField*) const
+{
+ return true;
+}
+
+
+// #pragma mark -
+
+BColumnListView::BColumnListView(BRect rect, const char *name, uint32 resizingMode,
+ uint32 drawFlags, border_style border, bool showHorizontalScrollbar)
+ : BView(rect, name, resizingMode, drawFlags | B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE),
+ fStatusView(0),
+ fSelectionMessage(0),
+ fSortingEnabled(true),
+ fLatchWidth(kLatchWidth),
+ fBorderStyle(border)
+{
+ SetViewColor(B_TRANSPARENT_32_BIT);
+
+ BRect bounds(rect);
+ bounds.OffsetTo(0, 0);
+
+ for (int i = 0; i < (int)B_COLOR_TOTAL; i++)
+ fColorList[i] = kColor[i];
+
+ BRect titleRect(bounds);
+ titleRect.bottom = titleRect.top + kTitleHeight;
+#if !LOWER_SCROLLBAR
+ titleRect.right -= B_V_SCROLL_BAR_WIDTH + 1;
+#endif
+
+ BRect outlineRect(bounds);
+ outlineRect.top = titleRect.bottom + 1.0;
+ outlineRect.right -= B_V_SCROLL_BAR_WIDTH + 1;
+ if(showHorizontalScrollbar)
+ outlineRect.bottom -= B_H_SCROLL_BAR_HEIGHT + 1;
+
+ BRect vScrollBarRect(bounds);
+#if LOWER_SCROLLBAR
+ vScrollBarRect.top += kTitleHeight;
+#endif
+
+ vScrollBarRect.left = vScrollBarRect.right - B_V_SCROLL_BAR_WIDTH;
+ if(showHorizontalScrollbar)
+ vScrollBarRect.bottom -= B_H_SCROLL_BAR_HEIGHT;
+
+ BRect hScrollBarRect(bounds);
+ hScrollBarRect.top = hScrollBarRect.bottom - B_H_SCROLL_BAR_HEIGHT;
+ hScrollBarRect.right -= B_V_SCROLL_BAR_WIDTH;
+
+ // Adjust stuff so the border will fit.
+ if (fBorderStyle == B_PLAIN_BORDER) {
+ titleRect.InsetBy(1, 0);
+ titleRect.top++;
+ outlineRect.InsetBy(1, 0);
+ outlineRect.bottom--;
+
+ vScrollBarRect.OffsetBy(-1, 0);
+ vScrollBarRect.InsetBy(0, 1);
+ hScrollBarRect.OffsetBy(0, -1);
+ hScrollBarRect.InsetBy(1, 0);
+ } else if (fBorderStyle == B_FANCY_BORDER) {
+ titleRect.InsetBy(2, 0);
+ titleRect.top += 2;
+ outlineRect.InsetBy(2, 0);
+ outlineRect.bottom -= 2;
+
+ vScrollBarRect.OffsetBy(-2, 0);
+ vScrollBarRect.InsetBy(0, 2);
+ hScrollBarRect.OffsetBy(0, -2);
+ hScrollBarRect.InsetBy(2, 0);
+ }
+
+ fOutlineView = new OutlineView(outlineRect, &fColumns, &fSortColumns, this);
+ AddChild(fOutlineView);
+
+
+ // Adapt to correct resizing mode
+ uint32 fParentFlags = resizingMode;
+ // Always follow LEFT_RIGHT
+ uint32 fTitleFlags = B_FOLLOW_LEFT_RIGHT;
+
+ if ((fParentFlags & B_FOLLOW_TOP) && (fParentFlags & ~B_FOLLOW_BOTTOM)) {
+ fTitleFlags |= B_FOLLOW_TOP;
+ }
+ else if ((fParentFlags & B_FOLLOW_BOTTOM) && (fParentFlags & ~B_FOLLOW_TOP)) {
+ fTitleFlags |= B_FOLLOW_BOTTOM;
+ }
+
+ fTitleView = new TitleView(titleRect, fOutlineView, &fColumns, &fSortColumns, this, fTitleFlags);
+
+
+ AddChild(fTitleView);
+ fVerticalScrollBar = new BScrollBar(vScrollBarRect, "vertical_scroll_bar",
+ fOutlineView, 0.0, bounds.Height(), B_VERTICAL);
+ AddChild(fVerticalScrollBar);
+ fHorizontalScrollBar = new BScrollBar(hScrollBarRect, "horizontal_scroll_bar",
+ fTitleView, 0.0, bounds.Width(), B_HORIZONTAL);
+ AddChild(fHorizontalScrollBar);
+ if(!showHorizontalScrollbar)
+ fHorizontalScrollBar->Hide();
+ fOutlineView->FixScrollBar(true);
+}
+
+BColumnListView::~BColumnListView()
+{
+ while (true) {
+ BColumn *column = (BColumn*) fColumns.RemoveItem(0L);
+ if (column == 0)
+ break;
+
+ delete column;
+ }
+}
+
+bool BColumnListView::InitiateDrag(BPoint, bool)
+{
+ return false;
+}
+
+void BColumnListView::MessageDropped(BMessage*, BPoint)
+{
+}
+
+void BColumnListView::ExpandOrCollapse(BRow* Row, bool Open)
+{
+ fOutlineView->ExpandOrCollapse(Row, Open);
+}
+
+status_t BColumnListView::Invoke(BMessage *message)
+{
+ if (message == 0)
+ message = Message();
+
+ return BInvoker::Invoke(message);
+}
+
+void BColumnListView::ItemInvoked()
+{
+ Invoke();
+}
+
+void BColumnListView::SetInvocationMessage(BMessage *message)
+{
+ SetMessage(message);
+}
+
+BMessage* BColumnListView::InvocationMessage() const
+{
+ return Message();
+}
+
+uint32 BColumnListView::InvocationCommand() const
+{
+ return Command();
+}
+
+BRow* BColumnListView::FocusRow() const
+{
+ return fOutlineView->FocusRow();
+}
+
+void BColumnListView::SetFocusRow(int32 Index, bool Select)
+{
+ SetFocusRow(RowAt(Index), Select);
+}
+
+void BColumnListView::SetFocusRow(BRow* Row, bool Select)
+{
+ fOutlineView->SetFocusRow(Row, Select);
+}
+
+void BColumnListView::SetMouseTrackingEnabled(bool Enabled)
+{
+ fOutlineView->SetMouseTrackingEnabled(Enabled);
+}
+
+list_view_type BColumnListView::SelectionMode() const
+{
+ return fOutlineView->SelectionMode();
+}
+
+void BColumnListView::Deselect(BRow *row)
+{
+ fOutlineView->Deselect(row);
+}
+
+void BColumnListView::AddToSelection(BRow *row)
+{
+ fOutlineView->AddToSelection(row);
+}
+
+void BColumnListView::DeselectAll()
+{
+ fOutlineView->DeselectAll();
+}
+
+BRow* BColumnListView::CurrentSelection(BRow *lastSelected) const
+{
+ return fOutlineView->CurrentSelection(lastSelected);
+}
+
+void BColumnListView::SelectionChanged()
+{
+ if (fSelectionMessage)
+ Invoke(fSelectionMessage);
+}
+
+void BColumnListView::SetSelectionMessage(BMessage *message)
+{
+ if (fSelectionMessage == message)
+ return;
+
+ delete fSelectionMessage;
+ fSelectionMessage = message;
+}
+
+BMessage* BColumnListView::SelectionMessage()
+{
+ return fSelectionMessage;
+}
+
+uint32 BColumnListView::SelectionCommand() const
+{
+ if (fSelectionMessage)
+ return fSelectionMessage->what;
+
+ return 0;
+}
+
+void BColumnListView::SetSelectionMode(list_view_type mode)
+{
+ fOutlineView->SetSelectionMode(mode);
+}
+
+void BColumnListView::SetSortingEnabled(bool enabled)
+{
+ fSortingEnabled = enabled;
+ fSortColumns.MakeEmpty();
+ fTitleView->Invalidate(); // Erase sort indicators
+}
+
+bool BColumnListView::SortingEnabled() const
+{
+ return fSortingEnabled;
+}
+
+void BColumnListView::SetSortColumn(BColumn *column, bool add, bool ascending)
+{
+ if (!SortingEnabled())
+ return;
+
+ if (!add)
+ fSortColumns.MakeEmpty();
+
+ if (!fSortColumns.HasItem(column))
+ fSortColumns.AddItem(column);
+
+ column->fSortAscending = ascending;
+ fTitleView->Invalidate();
+ fOutlineView->StartSorting();
+}
+
+void BColumnListView::ClearSortColumns()
+{
+ fSortColumns.MakeEmpty();
+ fTitleView->Invalidate(); // Erase sort indicators
+}
+
+void BColumnListView::AddStatusView(BView *view)
+{
+ BRect bounds = Bounds();
+ float width = view->Bounds().Width();
+ if (width > bounds.Width() / 2)
+ width = bounds.Width() / 2;
+
+ fStatusView = view;
+
+ Window()->BeginViewTransaction();
+ fHorizontalScrollBar->ResizeBy(-(width + 1), 0);
+ fHorizontalScrollBar->MoveBy((width + 1), 0);
+ AddChild(view);
+
+ BRect viewRect(bounds);
+ viewRect.right = width;
+ viewRect.top = viewRect.bottom - B_H_SCROLL_BAR_HEIGHT;
+ if (fBorderStyle == B_PLAIN_BORDER)
+ viewRect.OffsetBy(1, -1);
+ else if (fBorderStyle == B_FANCY_BORDER)
+ viewRect.OffsetBy(2, -2);
+
+ view->SetResizingMode(B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
+ view->ResizeTo(viewRect.Width(), viewRect.Height());
+ view->MoveTo(viewRect.left, viewRect.top);
+ Window()->EndViewTransaction();
+}
+
+BView* BColumnListView::RemoveStatusView()
+{
+ if (fStatusView) {
+ float width = fStatusView->Bounds().Width();
+ Window()->BeginViewTransaction();
+ fStatusView->RemoveSelf();
+ fHorizontalScrollBar->MoveBy(-width, 0);
+ fHorizontalScrollBar->ResizeBy(width, 0);
+ Window()->EndViewTransaction();
+ }
+
+ BView *view = fStatusView;
+ fStatusView = 0;
+ return view;
+}
+void BColumnListView::AddColumn(BColumn *column, int32 logicalFieldIndex)
+{
+ ASSERT(column != 0);
+
+ column->fList = this;
+ column->fFieldID = logicalFieldIndex;
+
+ // sanity check. If there is already a field with this ID, remove it.
+ for (int32 index = 0; index < fColumns.CountItems(); index++) {
+ BColumn *existingColumn = (BColumn*) fColumns.ItemAt(index);
+ if (existingColumn && existingColumn->fFieldID == logicalFieldIndex) {
+ RemoveColumn(existingColumn);
+ break;
+ }
+ }
+
+ if (column->Width() < column->MinWidth())
+ column->SetWidth(column->MinWidth());
+ else if (column->Width() > column->MaxWidth())
+ column->SetWidth(column->MaxWidth());
+
+ fColumns.AddItem((void*) column);
+ fTitleView->ColumnAdded(column);
+}
+
+void BColumnListView::MoveColumn(BColumn *column, int32 index)
+{
+ ASSERT(column != 0);
+ fTitleView->MoveColumn(column, index);
+}
+
+void BColumnListView::RemoveColumn(BColumn *column)
+{
+ if (fColumns.HasItem(column)) {
+ SetColumnVisible(column, false);
+ Window()->UpdateIfNeeded();
+ fColumns.RemoveItem(column);
+ }
+}
+
+int32 BColumnListView::CountColumns() const
+{
+ return fColumns.CountItems();
+}
+
+BColumn* BColumnListView::ColumnAt(int32 field) const
+{
+ return (BColumn*) fColumns.ItemAt(field);
+}
+
+void BColumnListView::SetColumnVisible(BColumn *column, bool visible)
+{
+ fTitleView->SetColumnVisible(column, visible);
+}
+
+void BColumnListView::SetColumnVisible(int32 index, bool isVisible)
+{
+ BColumn *column = ColumnAt(index);
+ if (column)
+ column->SetVisible(isVisible);
+}
+
+bool BColumnListView::IsColumnVisible(int32 index) const
+{
+ BColumn *column = ColumnAt(index);
+ if (column)
+ return column->IsVisible();
+
+ return false;
+}
+
+void BColumnListView::SetColumnFlags(column_flags flags)
+{
+ fTitleView->SetColumnFlags(flags);
+}
+
+const BRow* BColumnListView::RowAt(int32 Index, BRow* ParentRow) const
+{
+ if (ParentRow == 0)
+ return fOutlineView->RowList()->ItemAt(Index);
+
+ return ParentRow->fChildList ? ParentRow->fChildList->ItemAt(Index) : NULL;
+}
+
+BRow* BColumnListView::RowAt(int32 Index, BRow* ParentRow)
+{
+ if (ParentRow == 0)
+ return fOutlineView->RowList()->ItemAt(Index);
+
+ return ParentRow->fChildList ? ParentRow->fChildList->ItemAt(Index) : 0;
+}
+
+const BRow* BColumnListView::RowAt(BPoint point) const
+{
+ float top;
+ int32 indent;
+ return fOutlineView->FindRow(point.y, &indent, &top);
+}
+
+BRow* BColumnListView::RowAt(BPoint point)
+{
+ float top;
+ int32 indent;
+ return fOutlineView->FindRow(point.y, &indent, &top);
+}
+
+bool BColumnListView::GetRowRect(const BRow *row, BRect *outRect) const
+{
+ return fOutlineView->FindRect(row, outRect);
+}
+
+bool BColumnListView::FindParent(BRow *row, BRow **out_parent, bool *out_isVisible) const
+{
+ return fOutlineView->FindParent(row, out_parent, out_isVisible);
+}
+
+int32 BColumnListView::IndexOf(BRow *row)
+{
+ return fOutlineView->IndexOf(row);
+}
+
+int32 BColumnListView::CountRows(BRow* ParentRow) const
+{
+ if (ParentRow == 0)
+ return fOutlineView->RowList()->CountItems();
+ if (ParentRow->fChildList)
+ return ParentRow->fChildList->CountItems();
+ else
+ return 0;
+}
+
+void BColumnListView::AddRow(BRow *row, BRow* ParentRow)
+{
+ AddRow(row, -1, ParentRow);
+}
+
+void BColumnListView::AddRow(BRow *row, int32 index, BRow* ParentRow)
+{
+ row->fChildList = 0;
+ row->fList = this;
+ row->ValidateFields();
+ fOutlineView->AddRow(row, index, ParentRow);
+}
+
+void BColumnListView::RemoveRow(BRow *row)
+{
+ fOutlineView->RemoveRow(row);
+ row->fList = NULL;
+}
+
+void BColumnListView::UpdateRow(BRow *row)
+{
+ fOutlineView->UpdateRow(row);
+}
+
+void BColumnListView::ScrollTo(const BRow* Row)
+{
+ fOutlineView->ScrollTo(Row);
+}
+
+void BColumnListView::Clear()
+{
+ fOutlineView->Clear();
+}
+
+void BColumnListView::SetFont(const BFont *font, uint32 mask)
+{
+ // This method is deprecated.
+ fOutlineView->SetFont(font, mask);
+ fTitleView->SetFont(font, mask);
+}
+
+void BColumnListView::SetFont(ColumnListViewFont font_num, const BFont* font, uint32 mask)
+{
+ switch (font_num) {
+ case B_FONT_ROW:
+ fOutlineView->SetFont(font, mask);
+ break;
+
+ case B_FONT_HEADER:
+ fTitleView->SetFont(font, mask);
+ break;
+
+ default:
+ ASSERT(false);
+ break;
+ };
+}
+
+void BColumnListView::GetFont(ColumnListViewFont font_num, BFont* font) const
+{
+ switch (font_num) {
+ case B_FONT_ROW:
+ fOutlineView->GetFont(font);
+ break;
+
+ case B_FONT_HEADER:
+ fTitleView->GetFont(font);
+ break;
+
+ default:
+ ASSERT(false);
+ break;
+ };
+}
+
+void BColumnListView::SetColor(ColumnListViewColor color_num, const rgb_color color)
+{
+ if ((int)color_num < 0)
+ {
+ ASSERT(false);
+ color_num = (ColumnListViewColor) 0;
+ }
+
+ if ((int)color_num >= (int)B_COLOR_TOTAL)
+ {
+ ASSERT(false);
+ color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1);
+ }
+
+ fColorList[color_num] = color;
+}
+
+rgb_color BColumnListView::Color(ColumnListViewColor color_num) const
+{
+ if ((int)color_num < 0)
+ {
+ ASSERT(false);
+ color_num = (ColumnListViewColor) 0;
+ }
+
+ if ((int)color_num >= (int)B_COLOR_TOTAL)
+ {
+ ASSERT(false);
+ color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1);
+ }
+
+ return fColorList[color_num];
+}
+
+void BColumnListView::SetHighColor(rgb_color color)
+{
+ BView::SetHighColor(color);
+// fOutlineView->Invalidate(); // Redraw things with the new color
+ // Note that this will currently cause
+ // an infinite loop, refreshing over and over.
+ // A better solution is needed.
+}
+
+void BColumnListView::SetSelectionColor(rgb_color color)
+{
+ fColorList[B_COLOR_SELECTION] = color;
+}
+
+void BColumnListView::SetBackgroundColor(rgb_color color)
+{
+ fColorList[B_COLOR_BACKGROUND] = color;
+ fOutlineView->Invalidate(); // Repaint with new color
+}
+
+void BColumnListView::SetEditColor(rgb_color color)
+{
+ fColorList[B_COLOR_EDIT_BACKGROUND] = color;
+}
+
+const rgb_color BColumnListView::SelectionColor() const
+{
+ return fColorList[B_COLOR_SELECTION];
+}
+
+const rgb_color BColumnListView::BackgroundColor() const
+{
+ return fColorList[B_COLOR_BACKGROUND];
+}
+
+const rgb_color BColumnListView::EditColor() const
+{
+ return fColorList[B_COLOR_EDIT_BACKGROUND];
+}
+
+BPoint BColumnListView::SuggestTextPosition(const BRow* row, const BColumn* inColumn) const
+{
+ BRect rect;
+ GetRowRect(row, &rect);
+ if (inColumn) {
+ float leftEdge = MAX(kLeftMargin, LatchWidth());
+ for (int index = 0; index < fColumns.CountItems(); index++) {
+ BColumn *column = (BColumn*) fColumns.ItemAt(index);
+ if (!column->IsVisible())
+ continue;
+
+ if (column == inColumn) {
+ rect.left = leftEdge;
+ rect.right = rect.left + column->Width();
+ break;
+ }
+
+ leftEdge += column->Width() + 1;
+ }
+ }
+
+ font_height fh;
+ fOutlineView->GetFontHeight(&fh);
+ float baseline = floor(rect.top + fh.ascent
+ + (rect.Height()+1-(fh.ascent+fh.descent))/2);
+ return BPoint(rect.left + 8, baseline);
+}
+
+void BColumnListView::SetLatchWidth(float width)
+{
+ fLatchWidth = width;
+ Invalidate();
+}
+
+float BColumnListView::LatchWidth() const
+{
+ return fLatchWidth;
+}
+
+void BColumnListView::DrawLatch(BView *view, BRect rect, LatchType position, BRow *)
+{
+ const int32 rectInset = 4;
+
+ view->SetHighColor(0, 0, 0);
+
+ // Make Square
+ int32 sideLen = rect.IntegerWidth();
+ if( sideLen > rect.IntegerHeight() )
+ {
+ sideLen = rect.IntegerHeight();
+ }
+
+ // Make Center
+ int32 halfWidth = rect.IntegerWidth() / 2;
+ int32 halfHeight = rect.IntegerHeight() / 2;
+ int32 halfSide = sideLen / 2;
+
+ float left = rect.left + halfWidth - halfSide;
+ float top = rect.top + halfHeight - halfSide;
+
+ BRect itemRect(left, top, left + sideLen, top + sideLen);
+
+ // Why it is a pixel high? I don't know.
+ itemRect.OffsetBy(0, -1);
+
+ itemRect.InsetBy(rectInset, rectInset);
+
+ // Make it an odd number of pixels wide, the latch looks better this way
+ if (1 == (itemRect.IntegerWidth() % 2))
+ {
+ itemRect.right += 1;
+ itemRect.bottom += 1;
+ }
+
+ switch (position) {
+ case B_OPEN_LATCH:
+ view->StrokeRect(itemRect);
+ view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2),
+ BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2));
+ break;
+
+ case B_PRESSED_LATCH:
+ view->StrokeRect(itemRect);
+ view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2),
+ BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2));
+ view->StrokeLine(BPoint((itemRect.left + itemRect.right) / 2, itemRect.top + 2),
+ BPoint((itemRect.left + itemRect.right) / 2, itemRect.bottom - 2));
+ view->InvertRect(itemRect);
+ break;
+
+ case B_CLOSED_LATCH:
+ view->StrokeRect(itemRect);
+ view->StrokeLine(BPoint(itemRect.left + 2, (itemRect.top + itemRect.bottom) / 2),
+ BPoint(itemRect.right - 2, (itemRect.top + itemRect.bottom) / 2));
+ view->StrokeLine(BPoint((itemRect.left + itemRect.right) / 2, itemRect.top + 2),
+ BPoint((itemRect.left + itemRect.right) / 2, itemRect.bottom - 2));
+ break;
+
+ case B_NO_LATCH:
+ // No drawing
+ break;
+ }
+}
+
+void BColumnListView::MakeFocus(bool isFocus)
+{
+ Invalidate(); // Redraw focus marks around view
+ BView::MakeFocus(isFocus);
+}
+
+void BColumnListView::MessageReceived(BMessage *message)
+{
+ // Propagate mouse wheel messages down to child, so that it can
+ // scroll. Note we have done so, so we don't go into infinite
+ // recursion if this comes back up here.
+ if (message->what == B_MOUSE_WHEEL_CHANGED) {
+ bool handled;
+ if (message->FindBool("be:clvhandled", &handled) != B_OK) {
+ message->AddBool("be:clvhandled", true);
+ fOutlineView->MessageReceived(message);
+ return;
+ }
+ }
+ BView::MessageReceived(message);
+}
+
+void BColumnListView::KeyDown(const char *bytes, int32 numBytes)
+{
+ char c = bytes[0];
+ switch (c) {
+ case B_RIGHT_ARROW:
+ case B_LEFT_ARROW: {
+ float minVal, maxVal;
+ fHorizontalScrollBar->GetRange(&minVal, &maxVal);
+ float smallStep, largeStep;
+ fHorizontalScrollBar->GetSteps(&smallStep, &largeStep);
+ float oldVal = fHorizontalScrollBar->Value();
+ float newVal = oldVal;
+
+ if (c == B_LEFT_ARROW)
+ newVal -= smallStep;
+ else if (c == B_RIGHT_ARROW)
+ newVal += smallStep;
+
+ if (newVal < minVal)
+ newVal = minVal;
+ else if (newVal > maxVal)
+ newVal = maxVal;
+
+ fHorizontalScrollBar->SetValue(newVal);
+ break;
+ }
+
+ case B_DOWN_ARROW:
+ fOutlineView->ChangeFocusRow(false, (modifiers() & B_CONTROL_KEY) == 0,
+ (modifiers() & B_SHIFT_KEY) != 0);
+ break;
+
+ case B_UP_ARROW:
+ fOutlineView->ChangeFocusRow(true, (modifiers() & B_CONTROL_KEY) == 0,
+ (modifiers() & B_SHIFT_KEY) != 0);
+ break;
+
+ case B_PAGE_UP:
+ case B_PAGE_DOWN: {
+ float minValue, maxValue;
+ fVerticalScrollBar->GetRange(&minValue, &maxValue);
+ float smallStep, largeStep;
+ fVerticalScrollBar->GetSteps(&smallStep, &largeStep);
+ float currentValue = fVerticalScrollBar->Value();
+ float newValue = currentValue;
+
+ if (c == B_PAGE_UP)
+ newValue -= largeStep;
+ else
+ newValue += largeStep;
+
+ if (newValue > maxValue)
+ newValue = maxValue;
+ else if (newValue < minValue)
+ newValue = minValue;
+
+ fVerticalScrollBar->SetValue(newValue);
+
+ // Option + pgup or pgdn scrolls and changes the selection.
+ if (modifiers() & B_OPTION_KEY)
+ fOutlineView->MoveFocusToVisibleRect();
+
+ break;
+ }
+
+ case B_ENTER:
+ Invoke();
+ break;
+
+ case B_SPACE:
+ fOutlineView->ToggleFocusRowSelection((modifiers() & B_SHIFT_KEY) != 0);
+ break;
+
+ case '+':
+ fOutlineView->ToggleFocusRowOpen();
+ break;
+
+ default:
+ BView::KeyDown(bytes, numBytes);
+ }
+}
+
+void BColumnListView::AttachedToWindow()
+{
+ if (!Messenger().IsValid())
+ SetTarget(Window());
+
+ if (SortingEnabled()) fOutlineView->StartSorting();
+}
+
+void BColumnListView::WindowActivated(bool active)
+{
+ fOutlineView->Invalidate();
+ // Focus and selection appearance changes with focus
+
+ Invalidate(); // Redraw focus marks around view
+ BView::WindowActivated(active);
+}
+
+void BColumnListView::Draw(BRect)
+{
+ BRect rect = Bounds();
+ PushState();
+
+ BRect cornerRect(rect.right - B_V_SCROLL_BAR_WIDTH, rect.bottom - B_H_SCROLL_BAR_HEIGHT,
+ rect.right, rect.bottom);
+ if (fBorderStyle == B_PLAIN_BORDER) {
+ BView::SetHighColor(0, 0, 0);
+ StrokeRect(rect);
+ cornerRect.OffsetBy(-1, -1);
+ } else if (fBorderStyle == B_FANCY_BORDER) {
+ bool isFocus = IsFocus() && Window()->IsActive();
+
+ if (isFocus)
+ BView::SetHighColor(0, 0, 190); // Need to find focus color programatically
+ else
+ BView::SetHighColor(255, 255, 255);
+
+ StrokeRect(rect);
+ if (!isFocus)
+ BView::SetHighColor(184, 184, 184);
+ else
+ BView::SetHighColor(152, 152, 152);
+
+ rect.InsetBy(1,1);
+ StrokeRect(rect);
+ cornerRect.OffsetBy(-2, -2);
+ }
+
+ BView::SetHighColor(215, 215, 215); // fills lower right rect between scroll bars
+ FillRect(cornerRect);
+ PopState();
+}
+
+void BColumnListView::SaveState(BMessage *msg)
+{
+ msg->MakeEmpty();
+
+ // Damn compiler issuing l43m incorrect warnings.
+ int i;
+ for (i = 0; ;i++)
+ {
+ BColumn *col = (BColumn*) fColumns.ItemAt(i);
+ if(!col)
+ break;
+ msg->AddInt32("ID",col->fFieldID);
+ msg->AddFloat("width",col->fWidth);
+ msg->AddBool("visible",col->fVisible);
+ }
+
+ msg->AddBool("sortingenabled",fSortingEnabled);
+
+ if(fSortingEnabled)
+ {
+ for (i = 0; ;i++)
+ {
+ BColumn *col = (BColumn*) fSortColumns.ItemAt(i);
+ if(!col)
+ break;
+ msg->AddInt32("sortID",col->fFieldID);
+ msg->AddBool("sortascending",col->fSortAscending);
+ }
+ }
+}
+
+void BColumnListView::LoadState(BMessage *msg)
+{
+ for(int i=0;;i++)
+ {
+ int32 ID;
+ if(B_OK!=msg->FindInt32("ID",i,&ID))
+ break;
+ for(int j=0;;j++)
+ {
+ BColumn *col = (BColumn*) fColumns.ItemAt(j);
+ if(!col)
+ break;
+ if(col->fFieldID==ID)
+ {
+ // move this column to position 'i' and set its attributes
+ MoveColumn(col,i);
+ float f;
+ if(B_OK==msg->FindFloat("width",i,&f))
+ col->SetWidth(f);
+ bool b;
+ if(B_OK==msg->FindBool("visible",i,&b))
+ col->SetVisible(b);
+ }
+ }
+ }
+ bool b;
+ if(B_OK==msg->FindBool("sortingenabled",&b))
+ {
+ SetSortingEnabled(b);
+ // Damn compiler issuing l43m incorrect warnings.
+ for(int k=0;;k++)
+ {
+ int32 ID;
+ if(B_OK!=msg->FindInt32("sortID", k, &ID))
+ break;
+ for(int j=0;;j++)
+ {
+ BColumn *col = (BColumn*) fColumns.ItemAt(j);
+ if(!col)
+ break;
+ if(col->fFieldID==ID)
+ {
+ // add this column to the sort list
+ bool val;
+ if(B_OK==msg->FindBool("sortascending", k, &val))
+ SetSortColumn(col, true, val);
+ }
+ }
+ }
+ }
+}
+
+void BColumnListView::SetEditMode(bool state)
+{
+ fOutlineView->SetEditMode(state);
+ fTitleView->SetEditMode(state);
+}
+
+void BColumnListView::Refresh()
+{
+ if(LockLooper())
+ {
+ Invalidate();
+ fOutlineView->FixScrollBar (true);
+ fOutlineView->Invalidate();
+ Window()->UpdateIfNeeded();
+ UnlockLooper();
+ }
+}
+
+// #pragma mark -
+
+
+TitleView::TitleView(BRect rect, OutlineView *horizontalSlave, BList *visibleColumns,
+ BList *sortColumns, BColumnListView *listView, uint32 resizingMode)
+ : BView(rect, "title_view", resizingMode, B_WILL_DRAW | B_FRAME_EVENTS),
+ fOutlineView(horizontalSlave),
+ fColumns(visibleColumns),
+ fSortColumns(sortColumns),
+ fColumnsWidth(0),
+ fVisibleRect(rect.OffsetToCopy(0, 0)),
+ fCurrentState(INACTIVE),
+ fColumnPop(NULL),
+ fMasterView(listView),
+ fEditMode(false),
+ fColumnFlags(B_ALLOW_COLUMN_MOVE|B_ALLOW_COLUMN_RESIZE|B_ALLOW_COLUMN_POPUP|B_ALLOW_COLUMN_REMOVE)
+{
+ SetViewColor(B_TRANSPARENT_32_BIT);
+
+#if DOUBLE_BUFFERED_COLUMN_RESIZE
+ // xxx this needs to be smart about the size of the backbuffer.
+ BRect doubleBufferRect(0, 0, 600, 35);
+ fDrawBuffer = new BBitmap(doubleBufferRect, B_RGB32, true);
+ fDrawBufferView = new BView(doubleBufferRect, "double_buffer_view",
+ B_FOLLOW_ALL_SIDES, 0);
+ fDrawBuffer->Lock();
+ fDrawBuffer->AddChild(fDrawBufferView);
+ fDrawBuffer->Unlock();
+#endif
+
+ fUpSortArrow = new BBitmap(BRect(0, 0, 7, 7), B_COLOR_8_BIT);
+ fDownSortArrow = new BBitmap(BRect(0, 0, 7, 7), B_COLOR_8_BIT);
+
+ fUpSortArrow->SetBits((const void*) kUpSortArrow8x8, 64, 0, B_COLOR_8_BIT);
+ fDownSortArrow->SetBits((const void*) kDownSortArrow8x8, 64, 0, B_COLOR_8_BIT);
+
+#if _INCLUDES_CLASS_CURSOR
+ fResizeCursor = new BCursor(kResizeCursorData);
+ fMinResizeCursor = new BCursor(kMinResizeCursorData);
+ fMaxResizeCursor = new BCursor(kMaxResizeCursorData);
+ fColumnMoveCursor = new BCursor(kColumnMoveCursorData);
+#endif
+ FixScrollBar(true);
+}
+
+TitleView::~TitleView()
+{
+ delete fColumnPop;
+ fColumnPop = NULL;
+
+ fDrawBuffer->Lock();
+ fDrawBufferView->RemoveSelf();
+ fDrawBuffer->Unlock();
+ delete fDrawBufferView;
+ delete fDrawBuffer;
+ delete fUpSortArrow;
+ delete fDownSortArrow;
+
+#if _INCLUDES_CLASS_CURSOR
+ delete fResizeCursor;
+ delete fMaxResizeCursor;
+ delete fMinResizeCursor;
+ delete fColumnMoveCursor;
+#endif
+}
+
+void TitleView::ColumnAdded(BColumn *column)
+{
+ fColumnsWidth += column->Width() + 1;
+ FixScrollBar(false);
+ Invalidate();
+}
+// Could use a CopyBits here.
+void TitleView::SetColumnVisible(BColumn *column, bool visible)
+{
+ if (column->fVisible == visible)
+ return;
+
+ // If setting it visible, do this first so we can find its position
+ // to invalidate. If hiding it, do it last.
+ if (visible)
+ column->fVisible = visible;
+
+ BRect titleInvalid;
+ GetTitleRect(column, &titleInvalid);
+
+ // Now really set the visibility
+ column->fVisible = visible;
+
+ if (visible)
+ fColumnsWidth += column->Width();
+ else
+ fColumnsWidth -= column->Width();
+
+ BRect outlineInvalid(fOutlineView->VisibleRect());
+ outlineInvalid.left = titleInvalid.left;
+ titleInvalid.right = outlineInvalid.right;
+
+ Invalidate(titleInvalid);
+ fOutlineView->Invalidate(outlineInvalid);
+}
+
+void TitleView::GetTitleRect(BColumn *findColumn, BRect *out_rect)
+{
+ float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth());
+ int32 numColumns = fColumns->CountItems();
+ for (int index = 0; index < numColumns; index++) {
+ BColumn *column = (BColumn*) fColumns->ItemAt(index);
+ if (!column->IsVisible())
+ continue;
+
+ if (column == findColumn) {
+ out_rect->Set(leftEdge, 0, leftEdge + column->Width(), fVisibleRect.bottom);
+ return;
+ }
+
+ leftEdge += column->Width() + 1;
+ }
+
+ TRESPASS();
+}
+
+int32 TitleView::FindColumn(BPoint position, float *out_leftEdge)
+{
+ float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth());
+ int32 numColumns = fColumns->CountItems();
+ for (int index = 0; index < numColumns; index++) {
+ BColumn *column = (BColumn*) fColumns->ItemAt(index);
+ if (!column->IsVisible())
+ continue;
+
+ if (leftEdge > position.x)
+ break;
+
+ if (position.x >= leftEdge && position.x <= leftEdge + column->Width()) {
+ *out_leftEdge = leftEdge;
+ return index;
+ }
+
+ leftEdge += column->Width() + 1;
+ }
+
+ return 0;
+}
+
+void TitleView::FixScrollBar(bool scrollToFit)
+{
+ BScrollBar *hScrollBar = ScrollBar(B_HORIZONTAL);
+ if (hScrollBar) {
+ float virtualWidth = fColumnsWidth + MAX(kLeftMargin, fMasterView->LatchWidth()) +
+ kRightMargin * 2;
+
+ if (virtualWidth > fVisibleRect.Width()) {
+ hScrollBar->SetProportion(fVisibleRect.Width() / virtualWidth);
+
+ // Perform the little trick if the user is scrolled over too far.
+ // See OutlineView::FixScrollBar for a more in depth explanation
+ float maxScrollBarValue = virtualWidth - fVisibleRect.Width();
+ if (scrollToFit || hScrollBar->Value() <= maxScrollBarValue) {
+ hScrollBar->SetRange(0.0, maxScrollBarValue);
+ hScrollBar->SetSteps(50, fVisibleRect.Width());
+ }
+ } else if (hScrollBar->Value() == 0.0)
+ hScrollBar->SetRange(0.0, 0.0); // disable scroll bar.
+ }
+}
+
+void TitleView::DragSelectedColumn(BPoint position)
+{
+ float invalidLeft = fSelectedColumnRect.left;
+ float invalidRight = fSelectedColumnRect.right;
+
+ float leftEdge;
+ int32 columnIndex = FindColumn(position, &leftEdge);
+ fSelectedColumnRect.OffsetTo(leftEdge, 0);
+
+ MoveColumn(fSelectedColumn, columnIndex);
+
+ fSelectedColumn->fVisible = true;
+ ComputeDragBoundries(fSelectedColumn, position);
+
+ // Redraw the new column position
+ GetTitleRect(fSelectedColumn, &fSelectedColumnRect);
+ invalidLeft = MIN(fSelectedColumnRect.left, invalidLeft);
+ invalidRight = MAX(fSelectedColumnRect.right, invalidRight);
+
+ Invalidate(BRect(invalidLeft, 0, invalidRight, fVisibleRect.bottom));
+ fOutlineView->Invalidate(BRect(invalidLeft, 0, invalidRight,
+ fOutlineView->VisibleRect().bottom));
+
+ DrawTitle(this, fSelectedColumnRect, fSelectedColumn, true);
+}
+
+void TitleView::MoveColumn(BColumn *column, int32 index)
+{
+ fColumns->RemoveItem((void*) column);
+
+ if (-1 == index)
+ {
+ // Re-add the column at the end of the list.
+ fColumns->AddItem((void*) column);
+ }
+ else
+ {
+ fColumns->AddItem((void*) column, index);
+ }
+}
+
+void TitleView::SetColumnFlags(column_flags flags)
+{
+ fColumnFlags = flags;
+}
+
+
+void TitleView::ResizeSelectedColumn(BPoint position)
+{
+ float minWidth = fSelectedColumn->MinWidth();
+ float maxWidth = fSelectedColumn->MaxWidth();
+
+ float originalEdge = fSelectedColumnRect.left + fSelectedColumn->Width();
+ if (position.x > fSelectedColumnRect.left + maxWidth)
+ fSelectedColumn->SetWidth(maxWidth);
+ else if (position.x < fSelectedColumnRect.left + minWidth)
+ fSelectedColumn->SetWidth(minWidth);
+ else
+ fSelectedColumn->SetWidth(position.x - fSelectedColumnRect.left - 1);
+
+ float dX = fSelectedColumnRect.left + fSelectedColumn->Width() - originalEdge;
+ if (dX != 0) {
+ BRect originalRect(originalEdge, 0, 1000000.0, fVisibleRect.Height());
+ BRect movedRect(originalRect);
+ movedRect.OffsetBy(dX, 0);
+
+ // Update the size of the title column
+ BRect sourceRect(0, 0, fSelectedColumn->Width(), fVisibleRect.Height());
+ BRect destRect(sourceRect);
+ destRect.OffsetBy(fSelectedColumnRect.left, 0);
+
+#if DOUBLE_BUFFERED_COLUMN_RESIZE
+ fDrawBuffer->Lock();
+ fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_HEADER_BACKGROUND));
+ fDrawBufferView->FillRect(sourceRect);
+ DrawTitle(fDrawBufferView, sourceRect, fSelectedColumn, false);
+ fDrawBufferView->Sync();
+ fDrawBuffer->Unlock();
+
+ CopyBits(originalRect, movedRect);
+ DrawBitmap(fDrawBuffer, sourceRect, destRect);
+#else
+ CopyBits(originalRect, movedRect);
+ SetHighColor(fMasterView->Color(B_COLOR_HEADER_BACKGROUND));
+ FillRect(destRect);
+ DrawTitle(this, destRect, fSelectedColumn, false);
+#endif
+
+ // Update the body view
+ BRect slaveSize = fOutlineView->VisibleRect();
+ BRect slaveSource(originalRect);
+ slaveSource.bottom = slaveSize.bottom;
+ BRect slaveDest(movedRect);
+ slaveDest.bottom = slaveSize.bottom;
+ fOutlineView->CopyBits(slaveSource, slaveDest);
+ fOutlineView->RedrawColumn(fSelectedColumn, fSelectedColumnRect.left,
+ fResizingFirstColumn);
+
+ fColumnsWidth += dX;
+
+ // Update the cursor
+#if _INCLUDES_CLASS_CURSOR
+ if (fSelectedColumn->Width() == minWidth)
+ SetViewCursor(fMinResizeCursor, false);
+ else if (fSelectedColumn->Width() == maxWidth)
+ SetViewCursor(fMaxResizeCursor, false);
+ else
+ SetViewCursor(fResizeCursor, false);
+#endif
+ }
+}
+
+void TitleView::ComputeDragBoundries(BColumn *findColumn, BPoint )
+{
+ float previousColumnLeftEdge = -1000000.0;
+ float nextColumnRightEdge = 1000000.0;
+
+ bool foundColumn = false;
+ float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth());
+ int32 numColumns = fColumns->CountItems();
+ for (int index = 0; index < numColumns; index++) {
+ BColumn *column = (BColumn*) fColumns->ItemAt(index);
+ if (!column->IsVisible())
+ continue;
+
+ if (column == findColumn) {
+ foundColumn = true;
+ continue;
+ }
+
+ if (foundColumn) {
+ nextColumnRightEdge = leftEdge + column->Width();
+ break;
+ } else
+ previousColumnLeftEdge = leftEdge;
+
+ leftEdge += column->Width() + 1;
+ }
+
+ float rightEdge = leftEdge + findColumn->Width();
+
+ fLeftDragBoundry = MIN(previousColumnLeftEdge + findColumn->Width(), leftEdge);
+ fRightDragBoundry = MAX(nextColumnRightEdge, rightEdge);
+}
+
+void TitleView::DrawTitle(BView *view, BRect rect, BColumn *column, bool depressed)
+{
+ BRect drawRect;
+#ifndef HAIKU
+ rgb_color borderColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), BExperimental::make_color(0, 0, 0), 128);
+#else
+ rgb_color borderColor = mix_color(fMasterView->Color(B_COLOR_HEADER_BACKGROUND), make_color(0, 0, 0), 128);
+#endif
+ rgb_color backgroundColor;
+
+ rgb_color bevelHigh;
+ rgb_color bevelLow;
+ // Want exterior borders to overlap.
+ rect.right += 1;
+ drawRect = rect;
+ drawRect.InsetBy(2, 2);
+ if (...
[truncated message content] |
|
From: CVS C. to T. <the...@li...> - 2015-05-16 21:38:39
|
Revision: 725
http://sourceforge.net/p/themis/code/725
Author: mark_hellegers
Date: 2015-05-16 21:38:36 +0000 (Sat, 16 May 2015)
Log Message:
-----------
Doing an atomic_add on a volatile variable discards the qualifier and
fails to compile on Haiku. Reading what volatile is supposed to do, it
seems that it is not appropriate for what was intended here and not
needed.
Modified Paths:
--------------
trunk/themis/common/connection.h
trunk/themis/common/msgsystem.cpp
trunk/themis/common/msgsystem.h
trunk/themis/common/plugclass.h
trunk/themis/common/tcpmanager.h
trunk/themis/framework/app.h
trunk/themis/modules/http/httpv4.h
Modified: trunk/themis/common/connection.h
===================================================================
--- trunk/themis/common/connection.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/common/connection.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -188,9 +188,9 @@
int32 last_error;
double bytes_per_second;
bigtime_t first_data_received_time;
- volatile int32 notified_connect;
- volatile int32 notified_disconnect;
- volatile int32 already_connected;
+ int32 notified_connect;
+ int32 notified_disconnect;
+ int32 already_connected;
BufferPool * mBuffers;
public:
Modified: trunk/themis/common/msgsystem.cpp
===================================================================
--- trunk/themis/common/msgsystem.cpp 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/common/msgsystem.cpp 2015-05-16 21:38:36 UTC (rev 725)
@@ -45,7 +45,7 @@
BLocker MessageSystem::msgsyslock;
sem_id MessageSystem::process_sem=0;
sem_id MessageSystem::transmit_sem=0;
-volatile int32 MessageSystem::_Quit_Thread_=0;
+int32 MessageSystem::_Quit_Thread_=0;
thread_id MessageSystem::_ProcessThread_=0;
volatile uint32 MessageSystem::_messages_sent_=0;
volatile uint32 MessageSystem::_message_targets_=0;
@@ -148,7 +148,7 @@
broadcaster->broadcast_successful_receives=0;
MessageSystem *member;
msgsysclient_st *verifier;
- volatile int32 member_found;
+ int32 member_found;
BString member_name;
// printf("Message sender is %s\n",broadcaster->MsgSysObjectName());
while (cur!=NULL) {
Modified: trunk/themis/common/msgsystem.h
===================================================================
--- trunk/themis/common/msgsystem.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/common/msgsystem.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -185,7 +185,7 @@
*/
- static volatile int32 _Quit_Thread_;
+ static int32 _Quit_Thread_;
/*!
\brief The main thread function of the broadcast system.
@@ -260,12 +260,12 @@
\brief
*/
- volatile int32 _ms_receiver_quit_;
+ int32 _ms_receiver_quit_;
/*!
\brief
*/
- volatile int32 _msg_receiver_running_;
+ int32 _msg_receiver_running_;
/*!
\brief
@@ -275,7 +275,7 @@
BLocker local_msg_sys_lock;
- volatile int32 _broadcast_complete_;
+ int32 _broadcast_complete_;
public:
static const int32 DEBUG_INFO_MSG='dbim';
Modified: trunk/themis/common/plugclass.h
===================================================================
--- trunk/themis/common/plugclass.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/common/plugclass.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -130,7 +130,7 @@
BMessage *InitInfo;
//!This is a reference to the Plug-in Manager.
plugman *PlugMan;
- volatile int32 Cancel;
+ int32 Cancel;
bool uses_heartbeat;
public:
Modified: trunk/themis/common/tcpmanager.h
===================================================================
--- trunk/themis/common/tcpmanager.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/common/tcpmanager.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -59,7 +59,7 @@
*/
- volatile int32 _quitter_;
+ int32 _quitter_;
/*!
\brief Initializes the TCPManager object.
Modified: trunk/themis/framework/app.h
===================================================================
--- trunk/themis/framework/app.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/framework/app.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -67,7 +67,7 @@
//! The Preferences window.
PrefsWin * fPrefsWin;
//! Checks to see if the QuitRequested function has been called.
- volatile int32 fQR_called;
+ int32 fQR_called;
//! A counter for the generated unique IDs.
int32 fIDCounter;
//! The SiteHandler object.
Modified: trunk/themis/modules/http/httpv4.h
===================================================================
--- trunk/themis/modules/http/httpv4.h 2015-05-16 17:09:37 UTC (rev 724)
+++ trunk/themis/modules/http/httpv4.h 2015-05-16 21:38:36 UTC (rev 725)
@@ -280,7 +280,7 @@
BList *request_queue;//!< BList object containing build_request_st records to be converted into http_request_info_st records by the BuildRequest() function.
AuthManager *auth_manager;//!< Pointer to the authorization/authentication manager.
- volatile int32 _terminate_;//!< A flag to terminate all processing in HTTP, used to prepare for shutdown.
+ int32 _terminate_;//!< A flag to terminate all processing in HTTP, used to prepare for shutdown.
/*!
\brief Sets the various variables and flags to a known state.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-05-16 17:09:40
|
Revision: 724
http://sourceforge.net/p/themis/code/724
Author: mark_hellegers
Date: 2015-05-16 17:09:37 +0000 (Sat, 16 May 2015)
Log Message:
-----------
Removed use of BELIBRARIES variable as it does not exist on Haiku and does not seem to be needed on BeOS either.
Modified Paths:
--------------
trunk/themis/makefile
Modified: trunk/themis/makefile
===================================================================
--- trunk/themis/makefile 2015-04-26 16:44:50 UTC (rev 723)
+++ trunk/themis/makefile 2015-05-16 17:09:37 UTC (rev 724)
@@ -511,7 +511,7 @@
#$(BASE_INSTALL_DIR)Themis: frameworkdepends commondepends frameworkobjects commonobjects
@echo "Linking Themis."
@$(CC) -o$(BASE_INSTALL_DIR)Themis $(foreach file,$(notdir $(FRAMEWORKSOURCES:.cpp=.o)),$(FRAMEWORK_OBJECT_DIR)$(file)) $(foreach file,$(notdir $(COMMONSOURCES:.cpp=.o)),$(COMMON_OBJECT_DIR)$(file)) -Xlinker $(LDFLAGS) -L ./ \
- -L $(BELIBRARIES) -L $(BASE_APP_LIB_INSTALL_DIR) $(NETWORKLIBS) $(STDLIBS) -Xlinker -soname=_APP_ -O0 -lcl -lstdc++.r4 -ltranslation # -ldom /boot/develop/lib/x86/i386-mcount.o
+ -L $(BASE_APP_LIB_INSTALL_DIR) $(NETWORKLIBS) $(STDLIBS) -Xlinker -soname=_APP_ -O0 -lcl -lstdc++.r4 -ltranslation # -ldom /boot/develop/lib/x86/i386-mcount.o
@echo "Done linking, adding resource file."
@xres -o $(BASE_INSTALL_DIR)Themis framework/themis.rsrc
@mimeset -F $(BASE_INSTALL_DIR)Themis
@@ -561,7 +561,7 @@
fileaddon: framework $(BASE_ADDON_INSTALL_DIR)file_protocol.so
$(BASE_ADDON_INSTALL_DIR)file_protocol.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(FILEPROTOCOLSOURCES),$(BASE_ADDONS_OBJECT_DIR)FileProtocol/$(notdir $(file:.cpp=.o)))
@echo "Linking file protocol..."
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)file_protocol.so $(foreach file,$(notdir $(FILEPROTOCOLSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)FileProtocol/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=file_protocol.so -L ./ -L $(BELIBRARIES) $(STDLIBS) -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)file_protocol.so $(foreach file,$(notdir $(FILEPROTOCOLSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)FileProtocol/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=file_protocol.so -L ./ $(STDLIBS) -lstdc++.r4 _APP_
@mimeset -F $(BASE_ADDON_INSTALL_DIR)file_protocol.so
@echo "File Protocol plug-in compiled and linked successfully."
$(BASE_ADDONS_DEPENDS_DIR)FileProtocol/%.d: $(BASE_ADDON_SOURCE_DIR)FileProtocol/%.cpp
@@ -577,7 +577,7 @@
csspaddon: framework $(BASE_ADDON_INSTALL_DIR)css_parser.so domlib domstylelib
$(BASE_ADDON_INSTALL_DIR)css_parser.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(CSSPARSERSOURCES),$(BASE_ADDONS_OBJECT_DIR)CSSParser/$(notdir $(file:.cpp=.o)))
@echo "Linking css parser..."
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_parser.so $(foreach file,$(notdir $(CSSPARSERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSParser/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_parser.so -L ./ -L $(BELIBRARIES) -L $(BASE_APP_LIB_INSTALL_DIR) $(STDLIBS) -lstdc++.r4 -ldomstyle -ldom _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_parser.so $(foreach file,$(notdir $(CSSPARSERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSParser/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_parser.so -L ./ -L $(BASE_APP_LIB_INSTALL_DIR) $(STDLIBS) -lstdc++.r4 -ldomstyle -ldom _APP_
@mimeset -F $(BASE_ADDON_INSTALL_DIR)css_parser.so
@echo "CSS Parser plug-in compiled and linked successfully."
@mkdir -p /boot/home/config/settings/Themis/css
@@ -596,7 +596,7 @@
msgvaddon: msgvaddon $(BASE_ADDON_INSTALL_DIR)message_viewer.so
$(BASE_ADDON_INSTALL_DIR)message_viewer.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(MESSAGEVIEWERSOURCES),$(BASE_ADDONS_OBJECT_DIR)MsgViewer/$(notdir $(file:.cpp=.o)))
@echo "Linking Message Viewer..."
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)message_viewer.so $(foreach file,$(notdir $(MESSAGEVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)MsgViewer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=file_protocol.so -L ./ -L $(BELIBRARIES) $(STDLIBS) -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)message_viewer.so $(foreach file,$(notdir $(MESSAGEVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)MsgViewer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=file_protocol.so -L ./ $(STDLIBS) -lstdc++.r4 _APP_
@mimeset -F $(BASE_ADDON_INSTALL_DIR)message_viewer.so
@echo "Message Viewer plug-in compiled and linked successfully."
$(BASE_ADDONS_DEPENDS_DIR)MsgViewer/%.d: $(BASE_ADDON_SOURCE_DIR)MsgViewer/%.cpp
@@ -613,7 +613,7 @@
cacheaddon: framework $(BASE_ADDON_INSTALL_DIR)cache.so
$(BASE_ADDON_INSTALL_DIR)cache.so: $(BASE_INSTALL_DIR)Themis $(COMMONOBJ) $(foreach file,$(notdir $(CACHEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cache/$(file)) #cacheaddondepends cacheaddonobjects
@echo "Linking cache add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)cache.so $(foreach file,$(notdir $(CACHEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cache/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=cache.so -L ./ -L $(BELIBRARIES) $(STDLIBS) _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)cache.so $(foreach file,$(notdir $(CACHEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cache/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=cache.so -L ./ $(STDLIBS) _APP_
@echo "Cache add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)cache.so
@echo "Cache plug-in compiled and linked successfully."
@@ -641,7 +641,7 @@
testplug: framework $(BASE_ADDON_INSTALL_DIR)testplug.so
$(BASE_ADDON_INSTALL_DIR)testplug.so: $(BASE_INSTALL_DIR)Themis $(COMMONOBJ) $(foreach file,$(notdir $(TESTPLUGSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)testplug/$(file)) #testplugdepends testplugobjects
@echo "Linking testplug"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)testplug.so $(foreach file,$(notdir $(TESTPLUGSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)testplug/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=testplug.so -L ./ -L $(BELIBRARIES) -lbe -ltextencoding -lroot -ltranslation _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)testplug.so $(foreach file,$(notdir $(TESTPLUGSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)testplug/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=testplug.so -L ./ -lbe -ltextencoding -lroot -ltranslation _APP_
@echo "testplug add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)cache.so
@echo "testplug plug-in compiled and linked successfully."
@@ -669,7 +669,7 @@
imagehaddon: framework $(BASE_ADDON_INSTALL_DIR)image_handler.so
$(BASE_ADDON_INSTALL_DIR)image_handler.so: $(BASE_INSTALL_DIR)Themis $(COMMONOBJ) $(foreach file,$(notdir $(IMAGEHSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)imageh/$(file)) #commondepends imagehdepends commonobjects imagehobjects
@echo "Linking image handler"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)image_handler.so $(foreach file,$(notdir $(IMAGEHSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)imageh/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=image_handler.so -L ./ -L $(BELIBRARIES) -lbe -lroot -ltranslation _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)image_handler.so $(foreach file,$(notdir $(IMAGEHSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)imageh/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=image_handler.so -L ./ -lbe -lroot -ltranslation _APP_
@echo "image handler add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)cache.so
@echo "Image Handler plug-in compiled and linked successfully."
@@ -698,7 +698,7 @@
htmlpaddon: framework $(BASE_ADDON_INSTALL_DIR)html_parser.so domlib
$(BASE_ADDON_INSTALL_DIR)html_parser.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(HTMLPARSERSOURCES),$(BASE_ADDONS_OBJECT_DIR)HTMLParser/$(notdir $(file:.cpp=.o))) #domlib htmlparserdepends htmlparserobjects
@echo "Linking HTML Parser add-on $@"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)html_parser.so $(foreach file,$(notdir $(HTMLPARSERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)HTMLParser/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=html_parser.so -L ./ -L $(BELIBRARIES) -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldom -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)html_parser.so $(foreach file,$(notdir $(HTMLPARSERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)HTMLParser/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=html_parser.so -L ./ -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldom -lstdc++.r4 _APP_
@echo "HTML Parser add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)html_parser.so
@echo "HTML Parser plug-in compiled and linked successfully."
@@ -730,7 +730,7 @@
domvaddon: framework $(BASE_ADDON_INSTALL_DIR)DOMView.so domlib
$(BASE_ADDON_INSTALL_DIR)DOMView.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(DOMVIEWSOURCES),$(BASE_ADDONS_OBJECT_DIR)DOMView/$(notdir $(file:.cpp=.o))) #commondepends domvdepends commonobjects domvobjects
@echo "Linking DOM View add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)DOMView.so $(foreach file,$(notdir $(DOMVIEWSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)DOMView/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=DOMView.so -L ./ -L $(BELIBRARIES) -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldom -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)DOMView.so $(foreach file,$(notdir $(DOMVIEWSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)DOMView/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=DOMView.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldom -lstdc++.r4 _APP_
@echo "DOM View add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)DOMView.so
@echo "DOM View plug-in compiled and linked successfully."
@@ -758,7 +758,7 @@
cssvaddon: framework $(BASE_ADDON_INSTALL_DIR)css_viewer.so domlib
$(BASE_ADDON_INSTALL_DIR)css_viewer.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(CSSVIEWERSOURCES),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(notdir $(file:.cpp=.o)))
@echo "Linking CSS Viewer add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_viewer.so $(foreach file,$(notdir $(CSSVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_viewer.so -L ./ -L $(BELIBRARIES) -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldomstyle -ldom -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_viewer.so $(foreach file,$(notdir $(CSSVIEWERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSViewer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_viewer.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ldomstyle -ldom -lstdc++.r4 _APP_
@echo "CSS Viewer add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)css_viewer.so
@echo "CSS Viewer plug-in compiled and linked successfully."
@@ -786,7 +786,7 @@
cssraddon: framework $(BASE_ADDON_INSTALL_DIR)css_renderer.so domlib domstylelib
$(BASE_ADDON_INSTALL_DIR)css_renderer.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(CSSRENDERERSOURCES),$(BASE_ADDONS_OBJECT_DIR)CSSRenderer/$(notdir $(file:.cpp=.o)))
@echo "Linking CSS Renderer add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_renderer.so $(foreach file,$(notdir $(CSSRENDERERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSRenderer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_renderer.so -L ./ -L $(BELIBRARIES) -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ltranslation -ldomstyle -ldom -lstdc++.r4 _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)css_renderer.so $(foreach file,$(notdir $(CSSRENDERERSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)CSSRenderer/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=css_renderer.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ltranslation -ldomstyle -ldom -lstdc++.r4 _APP_
@echo "CSS Renderer add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)css_renderer.so
@echo "CSS Renderer plug-in compiled and linked successfully."
@@ -814,7 +814,7 @@
httpaddon: framework $(BASE_ADDON_INSTALL_DIR)http_plugin.so
$(BASE_ADDON_INSTALL_DIR)http_plugin.so: $(BASE_INSTALL_DIR)Themis $(foreach file,$(notdir $(HTTPADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)http/$(file)) #commondepends httpaddondepends commonobjects httpaddonobjects
@echo "Linking http add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)http_plugin.so $(foreach file,$(notdir $(HTTPADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)http/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=http_plugin.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lz -lcl -L $(BELIBRARIES) $(NETWORKLIBS) $(STDLIBS) -ltranslation _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)http_plugin.so $(foreach file,$(notdir $(HTTPADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)http/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=http_plugin.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -lz -lcl $(NETWORKLIBS) $(STDLIBS) -ltranslation _APP_
@echo "HTTP add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)http_plugin.so
@echo "HTTP plug-in compiled and linked successfully."
@@ -844,7 +844,7 @@
cookieaddon: framework $(BASE_ADDON_INSTALL_DIR)cookie_plugin.so
$(BASE_ADDON_INSTALL_DIR)cookie_plugin.so: $(BASE_INSTALL_DIR)Themis $(COMMONOBJ) $(foreach file,$(notdir $(COOKIEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cookie/$(file)) #commondepends cookieaddondepends commonobjects cookieaddonobjects
@echo "Linking cookie add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)cookie_plugin.so $(foreach file,$(notdir $(COOKIEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cookie/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=cookie_plugin.so -L ./ -L $(BELIBRARIES) -lbe -lroot -ltextencoding _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)cookie_plugin.so $(foreach file,$(notdir $(COOKIEADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)cookie/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=cookie_plugin.so -L ./ -lbe -lroot -ltextencoding _APP_
@echo "Cookie add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)cookie_plugin.so
@echo "Cookie plug-in compiled and linked successfully."
@@ -871,7 +871,7 @@
@echo "Copying Javscript library and supporting libraries to install directory."
@$(shell if [ "$(NETWORKING)" == "BONE" ] ; then /bin/unzip -uqd Themis/lib/ javascript/bone_jslibs.zip ; else /bin/unzip -uqd Themis/lib/ javascript/netserver_jslibs.zip ; fi )
@echo "Linking Javascript add-on"
- @$(CC) -o$(BASE_ADDON_INSTALL_DIR)js_plugin.so $(foreach file,$(notdir $(JSADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)js/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=js_plugin.so -L ./ -L javascript/ -L $(BELIBRARIES) -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ltextencoding -ljs -ldom _APP_
+ @$(CC) -o$(BASE_ADDON_INSTALL_DIR)js_plugin.so $(foreach file,$(notdir $(JSADDONSOURCES:.cpp=.o)),$(BASE_ADDONS_OBJECT_DIR)js/$(file)) -nostart -Xlinker $(LDFLAGS) -soname=js_plugin.so -L ./ -L javascript/ -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -lroot -ltextencoding -ljs -ldom _APP_
@echo "Javascript add-on is now linked. Doing mimeset."
@mimeset -F $(BASE_ADDON_INSTALL_DIR)js_plugin.so
@echo "Javascript plug-in compiled and linked successfully."
@@ -898,7 +898,7 @@
domlib: framework $(BASE_APP_LIB_INSTALL_DIR)libdom.so
$(BASE_APP_LIB_INSTALL_DIR)libdom.so: $(foreach file,$(notdir $(DOMLIBRARYSOURCES:.cpp=.o)),$(DOMLIBRARY_OBJECT_DIR)$(file)) #domlibdepends domlibobjects
@echo "Linking DOM Library"
- @$(CC) -o $(BASE_APP_LIB_INSTALL_DIR)libdom.so $(foreach file,$(notdir $(DOMLIBRARYSOURCES:.cpp=.o)),$(DOMLIBRARY_OBJECT_DIR)$(file)) -nostart -Xlinker $(LDFLAGS) -shared -Xlinker -soname=libdom.so -L ./ -L $(BELIBRARIES) -L $(DOMLIBRARY_OBJECT_DIR) -lstdc++.r4
+ @$(CC) -o $(BASE_APP_LIB_INSTALL_DIR)libdom.so $(foreach file,$(notdir $(DOMLIBRARYSOURCES:.cpp=.o)),$(DOMLIBRARY_OBJECT_DIR)$(file)) -nostart -Xlinker $(LDFLAGS) -shared -Xlinker -soname=libdom.so -L ./ -L $(DOMLIBRARY_OBJECT_DIR) -lstdc++.r4
@echo "DOM Library is now linked. Doing mimeset."
@mimeset -F $(BASE_APP_LIB_INSTALL_DIR)libdom.so
@echo "DOM Library compiled and linked successfully."
@@ -921,7 +921,7 @@
#DOM Test application
domtest: framework domlib domtestdepends domtestobjects
- @$(CC) -o $(BASE_INSTALL_DIR)DOMTest $(foreach file,$(notdir $(DOMTESTSOURCES:.cpp=.o)),$(DOMLIBRARY_OBJECT_DIR)$(file)) -Xlinker $(LDFLAGS) -L ./ -L $(BELIBRARIES) -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -ldom -lstdc++.r4
+ @$(CC) -o $(BASE_INSTALL_DIR)DOMTest $(foreach file,$(notdir $(DOMTESTSOURCES:.cpp=.o)),$(DOMLIBRARY_OBJECT_DIR)$(file)) -Xlinker $(LDFLAGS) -L ./ -L $(BASE_APP_LIB_INSTALL_DIR) -lbe -ldom -lstdc++.r4
@echo "DOM Test application is now linked. Doing mimeset."
@mimeset -F $(BASE_INSTALL_DIR)DOMTest
@echo "DOM Test application compiled and linked successfully."
@@ -938,7 +938,7 @@
domstylelib: framework $(BASE_APP_LIB_INSTALL_DIR)libdomstyle.so domlib
$(BASE_APP_LIB_INSTALL_DIR)libdomstyle.so: $(foreach file,$(notdir $(DOMSTYLELIBRARYSOURCES:.cpp=.o)),$(DOMSTYLELIBRARY_OBJECT_DIR)$(file))
@echo "Linking DOMStyle Library"
- @$(CC) -o $(BASE_APP_LIB_INSTALL_DIR)libdomstyle.so $(foreach file,$(notdir $(DOMSTYLELIBRARYSOURCES:.cpp=.o)),$(DOMSTYLELIBRARY_OBJECT_DIR)$(file)) -nostart -Xlinker $(LDFLAGS) -shared -Xlinker -soname=libdomstyle.so -L ./ -L $(BELIBRARIES) -L$(BASE_APP_LIB_INSTALL_DIR) -L $(DOMSTYLELIBRARY_OBJECT_DIR) -lstdc++.r4 -ldom
+ @$(CC) -o $(BASE_APP_LIB_INSTALL_DIR)libdomstyle.so $(foreach file,$(notdir $(DOMSTYLELIBRARYSOURCES:.cpp=.o)),$(DOMSTYLELIBRARY_OBJECT_DIR)$(file)) -nostart -Xlinker $(LDFLAGS) -shared -Xlinker -soname=libdomstyle.so -L ./ -L$(BASE_APP_LIB_INSTALL_DIR) -L $(DOMSTYLELIBRARY_OBJECT_DIR) -lstdc++.r4 -ldom
@echo "DOMStyle Library is now linked. Doing mimeset."
@mimeset -F $(BASE_APP_LIB_INSTALL_DIR)libdomstyle.so
@echo "DOMStyle Library compiled and linked successfully."
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-04-26 16:44:52
|
Revision: 723
http://sourceforge.net/p/themis/code/723
Author: mark_hellegers
Date: 2015-04-26 16:44:50 +0000 (Sun, 26 Apr 2015)
Log Message:
-----------
- Remove synchronous retry as it does not seem to do anything.
- Make sure we indicate we are done with the request when we could not get a connection.
Modified Paths:
--------------
trunk/themis/modules/http/httpv4.cpp
Modified: trunk/themis/modules/http/httpv4.cpp
===================================================================
--- trunk/themis/modules/http/httpv4.cpp 2015-04-26 16:42:26 UTC (rev 722)
+++ trunk/themis/modules/http/httpv4.cpp 2015-04-26 16:44:50 UTC (rev 723)
@@ -563,41 +563,29 @@
if (current->connection==connection)
{
current->internal_status|=STATUS_CONNECTION_CLOSED;
- if ((current->internal_status&STATUS_CONNECTED_TO_SERVER)==0)
- {//we never got connected before we got the terminated notification
- if ((current->internal_status&STATUS_NO_RESPONSE_FROM_SERVER)==0)
+ if ((current->internal_status&STATUS_CONNECTED_TO_SERVER)==0) {
+ //We never got connected before we got the terminated notification.
+ //Maybe the server isn't up or listening...
+ BMessage disconnect(SH_LOADING_PROGRESS);
+ disconnect.AddInt32("command",COMMAND_INFO);
+ disconnect.AddInt32("site_id",current->site_id);
+ disconnect.AddInt32("url_id",current->url_id);
+ disconnect.AddString("url",current->url);
+ disconnect.AddInt64("bytes-received",current->bytes_received);
+ disconnect.AddBool("request_done",true);
+ disconnect.AddBool("secure",current->secure);
+ disconnect.AddBool("aborted",true);
+ if (current->content_type!=NULL)
{
- //The original attempt to connect to the server asynchronously failed.
- //Try again synchronously.
-// printf("HTTPv4: Switching to synchronous socket for host %s\n",current->host);
- //tcp_manager->Disconnect(connection);//DoneWithSession(connection);
- current->connection->OwnerRelease();
- current->connection=NULL;
- current->internal_status^=(STATUS_CONNECTION_CLOSED|STATUS_NO_RESPONSE_FROM_SERVER);
-// current->connection=tcp_manager->CreateConnection(this,current->host,current->port,current->secure,false);
- } else
- {
- //The synchronous attempt also failed... Maybe the server isn't up or listening...
- BMessage disconnect(SH_LOADING_PROGRESS);
- disconnect.AddInt32("command",COMMAND_INFO);
- disconnect.AddInt32("site_id",current->site_id);
- disconnect.AddInt32("url_id",current->url_id);
- disconnect.AddString("url",current->url);
- disconnect.AddInt64("bytes-received",current->bytes_received);
- disconnect.AddBool("request_done",true);
- disconnect.AddBool("secure",current->secure);
- disconnect.AddBool("aborted",true);
- if (current->content_type!=NULL)
- {
- disconnect.AddString("content-type",current->content_type);
- disconnect.AddString("mime-type",current->content_type);
- }
- Broadcast(MS_TARGET_ALL,&disconnect);
- current->connection->OwnerRelease();
- current->connection=NULL;
- // tcp_manager->DoneWithSession(connection);
- current->internal_status|=(STATUS_NO_RESPONSE_FROM_SERVER|STATUS_NO_DATA_FROM_SERVER|STATUS_CONNECTION_CLOSED);
+ disconnect.AddString("content-type",current->content_type);
+ disconnect.AddString("mime-type",current->content_type);
}
+ Broadcast(MS_TARGET_ALL,&disconnect);
+ current->connection->OwnerRelease();
+ current->connection=NULL;
+ // tcp_manager->DoneWithSession(connection);
+ current->internal_status|=(STATUS_NO_RESPONSE_FROM_SERVER|STATUS_NO_DATA_FROM_SERVER|STATUS_CONNECTION_CLOSED);
+ DoneWithRequest(current);
} else
{//connected to server successfully, now disconnecting...
current->internal_status|=STATUS_CONNECTION_CLOSED;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-04-26 16:42:28
|
Revision: 722
http://sourceforge.net/p/themis/code/722
Author: mark_hellegers
Date: 2015-04-26 16:42:26 +0000 (Sun, 26 Apr 2015)
Log Message:
-----------
Lock the object before creating the connection to prevent a race condition with the layer_manager of the HTTPv4 module.
Modified Paths:
--------------
trunk/themis/framework/tcpmanager.cpp
Modified: trunk/themis/framework/tcpmanager.cpp
===================================================================
--- trunk/themis/framework/tcpmanager.cpp 2015-04-26 15:07:05 UTC (rev 721)
+++ trunk/themis/framework/tcpmanager.cpp 2015-04-26 16:42:26 UTC (rev 722)
@@ -226,8 +226,8 @@
Connection *TCPManager::CreateConnection(NetworkableObject *net_obj,const char *host,uint16 port,bool secure,bool asynch) {
//printf("CreateConnection begun\n");
Connection *connection=NULL;
-// BAutolock alock(lock);
-// if (alock.IsLocked()) {
+ BAutolock alock(lock);
+ if (alock.IsLocked()) {
int32 connections=0;
Connection *target_connection=NULL;
connections=Connection::CountConnections();
@@ -257,7 +257,7 @@
sessions_created++;
}
-// }
+ }
//printf("CreateConnection is done: %p\n",connection);
return connection;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: CVS C. to T. <the...@li...> - 2015-04-26 15:07:12
|
Revision: 721
http://sourceforge.net/p/themis/code/721
Author: mark_hellegers
Date: 2015-04-26 15:07:05 +0000 (Sun, 26 Apr 2015)
Log Message:
-----------
Removed comment accidentally left in. Grr.
Modified Paths:
--------------
trunk/themis/framework/connection.cpp
Modified: trunk/themis/framework/connection.cpp
===================================================================
--- trunk/themis/framework/connection.cpp 2015-04-26 15:04:50 UTC (rev 720)
+++ trunk/themis/framework/connection.cpp 2015-04-26 15:07:05 UTC (rev 721)
@@ -650,7 +650,6 @@
return bytes;
}
off_t Connection::Send(void *data, off_t size) {
- printf("Sending data\n");
off_t bytes=0L;
BAutolock alock(lock);
if (alock.IsLocked()){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|