Making it build. Mostly untested. I just wanted to be able to jam from within src/apps. Not part of the image.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40964 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2011-03-15 17:41:41 +00:00
parent 490435a191
commit 2708c3e1c8
2 changed files with 15 additions and 20 deletions
+13 -18
View File
@@ -38,7 +38,6 @@ ConfigMenu::ConfigMenu(TrayView *tv, bool useMag)
BMenu *tmpm; BMenu *tmpm;
BMenuItem *tmpi; BMenuItem *tmpi;
BMessage *msg; BMessage *msg;
bigtime_t delay;
AutoRaiseSettings *s = tv->Settings(); AutoRaiseSettings *s = tv->Settings();
@@ -97,13 +96,13 @@ ConfigMenu::ConfigMenu(TrayView *tv, bool useMag)
msg = new BMessage(MSG_SET_BEHAVIOUR); msg = new BMessage(MSG_SET_BEHAVIOUR);
msg->AddInt32(AR_BEHAVIOUR, B_WARP_FOCUS_FOLLOWS_MOUSE); msg->AddInt32(AR_BEHAVIOUR, B_WARP_FOCUS_FOLLOWS_MOUSE);
tmpi = new BMenuItem("Warping (ffm)", msg); tmpi = new BMenuItem("Warping (ffm)", msg);
tmpi->SetMarked(tv->fNormalMM == B_WARP_FOCUS_FOLLOWS_MOUSE); tmpi->SetMarked(tv->fNormalMM == (mode_mouse)B_WARP_FOCUS_FOLLOWS_MOUSE);
tmpm->AddItem(tmpi); tmpm->AddItem(tmpi);
msg = new BMessage(MSG_SET_BEHAVIOUR); msg = new BMessage(MSG_SET_BEHAVIOUR);
msg->AddInt32(AR_BEHAVIOUR, B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE); msg->AddInt32(AR_BEHAVIOUR, B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE);
tmpi = new BMenuItem("Instant warping (ffm)", msg); tmpi = new BMenuItem("Instant warping (ffm)", msg);
tmpi->SetMarked(tv->fNormalMM == B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE); tmpi->SetMarked(tv->fNormalMM == (mode_mouse)B_INSTANT_WARP_FOCUS_FOLLOWS_MOUSE);
tmpm->AddItem(tmpi); tmpm->AddItem(tmpi);
tmpm->SetTargetForItems(tv); tmpm->SetTargetForItems(tv);
@@ -290,7 +289,7 @@ TrayView::~TrayView(){
} }
//Dehydrate into a message (called by the DeskBar) //Dehydrate into a message (called by the DeskBar)
status_t TrayView::Archive(BMessage *data, bool deep = true) const { status_t TrayView::Archive(BMessage *data, bool deep) const {
// BEntry appentry(&_appPath, true); // BEntry appentry(&_appPath, true);
// BPath appPath(&appentry); // BPath appPath(&appentry);
status_t error=BView::Archive(data, deep); status_t error=BView::Archive(data, deep);
@@ -298,7 +297,7 @@ status_t TrayView::Archive(BMessage *data, bool deep = true) const {
// data->AddFlat("_appPath", (BFlattenable *) &_appPath); // data->AddFlat("_appPath", (BFlattenable *) &_appPath);
data->AddRef("_appPath", &_appPath); data->AddRef("_appPath", &_appPath);
return B_NO_ERROR; return error;
} }
//Rehydrate the View from a given message (called by the DeskBar) //Rehydrate the View from a given message (called by the DeskBar)
@@ -393,8 +392,6 @@ int32 fronter(void *arg)
int32 tok = tv->current_window; int32 tok = tv->current_window;
int32 ws = current_workspace(); int32 ws = current_workspace();
sem_id sem = tv->fPollerSem; sem_id sem = tv->fPollerSem;
int32 *tl, tlc;
window_info *wi;
snooze(tv->raise_delay); snooze(tv->raise_delay);
@@ -495,17 +492,10 @@ printf("if (!%s && (%li, %li)isin(%li)(%li, %li, %li, %li) && (%li != %li) ", wi
void TrayView::MessageReceived(BMessage* message) void TrayView::MessageReceived(BMessage* message)
{ {
BMessenger msgr; BMessenger msgr;
int32 *tl, tlc;
port_id pi;
int32 tok;
window_info *wi;
BAlert *alert; BAlert *alert;
bigtime_t delay; bigtime_t delay;
int32 mode; int32 mode;
bool wasactive;
BPoint mouse;
uint32 buttons;
switch(message->what) switch(message->what)
{ {
@@ -530,8 +520,9 @@ void TrayView::MessageReceived(BMessage* message)
_settings->SetMode(mode); _settings->SetMode(mode);
break; break;
case MSG_SET_BEHAVIOUR: case MSG_SET_BEHAVIOUR:
{
message->FindInt32(AR_BEHAVIOUR, &mode); message->FindInt32(AR_BEHAVIOUR, &mode);
wasactive = _settings->Active(); bool wasactive = _settings->Active();
if (wasactive) if (wasactive)
SetActive(false); SetActive(false);
fNormalMM = (mode_mouse)mode; fNormalMM = (mode_mouse)mode;
@@ -539,6 +530,7 @@ void TrayView::MessageReceived(BMessage* message)
if (wasactive) if (wasactive)
SetActive(true); SetActive(true);
break; break;
}
case REMOVE_FROM_TRAY: case REMOVE_FROM_TRAY:
{ {
thread_id tid = spawn_thread(removeFromDeskbar, "RemoveFromDeskbar", B_NORMAL_PRIORITY, NULL); thread_id tid = spawn_thread(removeFromDeskbar, "RemoveFromDeskbar", B_NORMAL_PRIORITY, NULL);
@@ -559,6 +551,8 @@ void TrayView::MessageReceived(BMessage* message)
case B_SOME_WINDOW_ACTIVATED: case B_SOME_WINDOW_ACTIVATED:
// printf("Window Activated\n"); // printf("Window Activated\n");
// message->PrintToStream(); // message->PrintToStream();
BPoint mouse;
uint32 buttons;
GetMouse(&mouse, &buttons); GetMouse(&mouse, &buttons);
if (buttons) if (buttons)
break; break;
@@ -567,14 +561,15 @@ void TrayView::MessageReceived(BMessage* message)
else { else {
bool doZoom = false; bool doZoom = false;
BRect zoomRect(0.0f, 0.0f, 0.0f, 0.0f); BRect zoomRect(0.0f, 0.0f, 0.0f, 0.0f);
pi = msgr.fPort; port_id pi = msgr.fPort;
// printf("port:%li (%lx)\n", pi, pi); // printf("port:%li (%lx)\n", pi, pi);
int32 *tl, tlc;
tl = get_token_list(msgr.Team(), &tlc); tl = get_token_list(msgr.Team(), &tlc);
// printf("tokens (team %li): (%li) ", msgr.Team(), tlc); // printf("tokens (team %li): (%li) ", msgr.Team(), tlc);
for (tlc; tlc; tlc--) { for (tlc; tlc; tlc--) {
// printf("%li ", tl[tlc-1]); // printf("%li ", tl[tlc-1]);
wi = get_window_info(tl[tlc-1]); window_info *wi = get_window_info(tl[tlc-1]);
if (wi) { if (wi) {
if (wi->client_port == pi) { if (wi->client_port == pi) {
if ((wi->layer < 3) // we hit the desktop or a window not on this WS if ((wi->layer < 3) // we hit the desktop or a window not on this WS
@@ -589,7 +584,7 @@ void TrayView::MessageReceived(BMessage* message)
if ((_settings->Mode() == Mode_All) || (wi->team == fDeskbarTeam)) { if ((_settings->Mode() == Mode_All) || (wi->team == fDeskbarTeam)) {
PRINT(("raising wi=%li, cp=%ld, pi=%ld team=%ld DBteam=%ld\n", wi->id, wi->client_port, pi, wi->team, fDeskbarTeam)); PRINT(("raising wi=%li, cp=%ld, pi=%ld team=%ld DBteam=%ld\n", wi->id, wi->client_port, pi, wi->team, fDeskbarTeam));
current_window = wi->id; current_window = wi->id;
tok = wi->id; int32 tok = wi->id;
resume_thread(last_raiser_thread = spawn_thread(fronter, "fronter", B_NORMAL_PRIORITY, (void *)this)); resume_thread(last_raiser_thread = spawn_thread(fronter, "fronter", B_NORMAL_PRIORITY, (void *)this));
} else { } else {
current_window = wi->id; current_window = wi->id;
+2 -2
View File
@@ -1,5 +1,5 @@
#include "settings.h" #include "settings.h"
#include <iostream.h> #include <iostream>
#define CONF_ADDPROP(_type, _name) \ #define CONF_ADDPROP(_type, _name) \
void AutoRaiseSettings::Set##_name(_type value)\ void AutoRaiseSettings::Set##_name(_type value)\
@@ -7,7 +7,7 @@ void AutoRaiseSettings::Set##_name(_type value)\
_conf##_name = value;\ _conf##_name = value;\
}\ }\
\ \
_type AutoRaiseSettings::##_name()\ _type AutoRaiseSettings::_name()\
{\ {\
return _conf##_name;\ return _conf##_name;\
}\ }\