/***************************************************************************** * InterfaceWindow::_RestoreSettings *****************************************************************************/ void InterfaceWindow::_RestoreSettings() { if ( load_settings( fSettings, "interface_settings", "VideoLAN Client" ) == B_OK ) { BRect frame; if ( fSettings->FindRect( "main frame", &frame ) == B_OK ) set_window_pos( this, frame ); #if 0 if (fSettings->FindRect( "playlist frame", &frame ) == B_OK ) set_window_pos( fPlaylistWindow, frame ); #endif if (fSettings->FindRect( "messages frame", &frame ) == B_OK ) set_window_pos( fMessagesWindow, frame ); if (fSettings->FindRect( "settings frame", &frame ) == B_OK ) { /* FIXME: Preferences resizing doesn't work correctly yet */ frame.right = frame.left + fPreferencesWindow->Frame().Width(); frame.bottom = frame.top + fPreferencesWindow->Frame().Height(); set_window_pos( fPreferencesWindow, frame ); } bool showing; #if 0 if ( fSettings->FindBool( "playlist showing", &showing ) == B_OK ) launch_window( fPlaylistWindow, showing ); #endif if ( fSettings->FindBool( "messages showing", &showing ) == B_OK ) launch_window( fMessagesWindow, showing ); if ( fSettings->FindBool( "settings showing", &showing ) == B_OK ) launch_window( fPreferencesWindow, showing ); #if 0 uint32 displayMode; if ( fSettings->FindInt32( "playlist display mode", (int32*)&displayMode ) == B_OK ) fPlaylistWindow->SetDisplayMode( displayMode ); #endif } }
int set_win_pos_relative(HWND hparent,HWND hwin,int x,int y) { RECT rect; int w,h; if(0==hparent || 0==hwin) return 0; GetWindowRect(hparent,&rect); x=rect.left+x; y=rect.top+y; GetWindowRect(hwin,&rect); w=rect.right-rect.left; h=rect.bottom-rect.top; return set_window_pos(hwin,x,y,w,h,FALSE); }
void sync_display(void) { #ifdef CONF_MPI MPI_Status stat; int size = 0; #endif int rank = 0; char name[MAXNAME]; int i = 0; gethostname(name, MAXNAME); #ifdef CONF_MPI assert_mpi(MPI_Comm_rank(MPI_COMM_WORLD, &rank)); assert_mpi(MPI_Comm_size(MPI_COMM_WORLD, &size)); if (rank) { /* Send the name to the root, recieve the host index. */ MPI_Send(name, MAXNAME, MPI_BYTE, 0,0, MPI_COMM_WORLD); MPI_Recv(&i, 4, MPI_BYTE, 0,0, MPI_COMM_WORLD, &stat); } else { int j, k; /* Find a host definition for the root. */ i = find_display(name); /* Recieve a name from each client, send a host definition index. */ for (j = 1; j < size; ++j) { MPI_Recv(name, MAXNAME, MPI_BYTE, j,0, MPI_COMM_WORLD, &stat); k = find_display(name); MPI_Send(&k, 4, MPI_BYTE, j,0, MPI_COMM_WORLD); } } #else i = find_display(name); #endif /* If no host definition was found, create a default. */ if (i == 0) { i = add_host(DEFAULT_NAME, DEFAULT_X, DEFAULT_Y, DEFAULT_W, DEFAULT_H); add_tile(i, DEFAULT_X, DEFAULT_Y, DEFAULT_W, DEFAULT_H); host[i].flags = HOST_FRAMED; } /* Note the indexed host definition as current. */ current_host = host[i]; /* Position the server window, if necessary. */ if (rank || (current_host.flags & HOST_FRAMED) == 0) set_window_pos(current_host.win_x, current_host.win_y); }