* Added new (private) calls {get|set}_workspaces_layout().
* Implemented old count_workspaces(), and set_workspace_count() using the new functions. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31971 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,6 +19,9 @@ bool get_mode_parameter(uint32 mode, int32& width, int32& height,
|
|||||||
uint32& colorSpace);
|
uint32& colorSpace);
|
||||||
int32 get_bytes_per_row(color_space colorSpace, int32 width);
|
int32 get_bytes_per_row(color_space colorSpace, int32 width);
|
||||||
|
|
||||||
|
void get_workspaces_layout(uint32* _columns, uint32* _rows);
|
||||||
|
void set_workspaces_layout(uint32 columns, uint32 rows);
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
/*! Global functions and variables for the Interface Kit */
|
/*! Global functions and variables for the Interface Kit */
|
||||||
|
|
||||||
#include <InterfacePrivate.h>
|
#include <InterfaceDefs.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include <InterfaceDefs.h>
|
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <ScrollBar.h>
|
#include <ScrollBar.h>
|
||||||
@@ -32,6 +31,7 @@
|
|||||||
#include <DefaultColors.h>
|
#include <DefaultColors.h>
|
||||||
#include <InputServerTypes.h>
|
#include <InputServerTypes.h>
|
||||||
#include <input_globals.h>
|
#include <input_globals.h>
|
||||||
|
#include <InterfacePrivate.h>
|
||||||
#include <MenuPrivate.h>
|
#include <MenuPrivate.h>
|
||||||
#include <pr_server.h>
|
#include <pr_server.h>
|
||||||
#include <ServerProtocol.h>
|
#include <ServerProtocol.h>
|
||||||
@@ -194,6 +194,43 @@ get_mode_parameter(uint32 mode, int32& width, int32& height, uint32& colorSpace)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
get_workspaces_layout(uint32* _columns, uint32* _rows)
|
||||||
|
{
|
||||||
|
int32 columns = 1;
|
||||||
|
int32 rows = 1;
|
||||||
|
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_GET_WORKSPACE_LAYOUT);
|
||||||
|
|
||||||
|
status_t status;
|
||||||
|
if (link.FlushWithReply(status) == B_OK && status == B_OK) {
|
||||||
|
link.Read<int32>(&columns);
|
||||||
|
link.Read<int32>(&rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_columns != NULL)
|
||||||
|
*_columns = columns;
|
||||||
|
if (_rows != NULL)
|
||||||
|
*_rows = rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
set_workspaces_layout(uint32 columns, uint32 rows)
|
||||||
|
{
|
||||||
|
if (columns < 1 || rows < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_SET_WORKSPACE_LAYOUT);
|
||||||
|
link.Attach<int32>(columns);
|
||||||
|
link.Attach<int32>(rows);
|
||||||
|
link.Flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
@@ -718,17 +755,9 @@ keyboard_navigation_color()
|
|||||||
int32
|
int32
|
||||||
count_workspaces()
|
count_workspaces()
|
||||||
{
|
{
|
||||||
int32 columns = 1;
|
uint32 columns;
|
||||||
int32 rows = 1;
|
uint32 rows;
|
||||||
|
BPrivate::get_workspaces_layout(&columns, &rows);
|
||||||
BPrivate::AppServerLink link;
|
|
||||||
link.StartMessage(AS_GET_WORKSPACE_LAYOUT);
|
|
||||||
|
|
||||||
status_t status;
|
|
||||||
if (link.FlushWithReply(status) == B_OK && status == B_OK) {
|
|
||||||
link.Read<int32>(&columns);
|
|
||||||
link.Read<int32>(&rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
return columns * rows;
|
return columns * rows;
|
||||||
}
|
}
|
||||||
@@ -747,11 +776,7 @@ set_workspace_count(int32 count)
|
|||||||
|
|
||||||
int32 columns = count / rows;
|
int32 columns = count / rows;
|
||||||
|
|
||||||
BPrivate::AppServerLink link;
|
BPrivate::set_workspaces_layout(columns, rows);
|
||||||
link.StartMessage(AS_SET_WORKSPACE_LAYOUT);
|
|
||||||
link.Attach<int32>(columns);
|
|
||||||
link.Attach<int32>(rows);
|
|
||||||
link.Flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user