Initial Implementation for coordinate switching
This commit is contained in:
parent
653e4badeb
commit
f0daa312d0
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(rg:*)",
|
||||||
|
"Bash(g++:*)",
|
||||||
|
"Bash(cmake:*)",
|
||||||
|
"Bash(sudo apt:*)",
|
||||||
|
"Bash(sudo apt install:*)"
|
||||||
|
],
|
||||||
|
"deny": []
|
||||||
|
}
|
||||||
|
}
|
|
@ -40,7 +40,10 @@ Action::Action() :
|
||||||
m_SwitchDirection(switchLeft),
|
m_SwitchDirection(switchLeft),
|
||||||
m_LockCursorMode(lockCursorToggle),
|
m_LockCursorMode(lockCursorToggle),
|
||||||
m_ActiveOnRelease(false),
|
m_ActiveOnRelease(false),
|
||||||
m_HasScreens(false)
|
m_HasScreens(false),
|
||||||
|
m_hasCustomPosition(false),
|
||||||
|
m_customX(0),
|
||||||
|
m_customY(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,6 +90,12 @@ QString Action::text() const
|
||||||
case switchToScreen:
|
case switchToScreen:
|
||||||
text += "(";
|
text += "(";
|
||||||
text += switchScreenName();
|
text += switchScreenName();
|
||||||
|
if (hasCustomPosition()) {
|
||||||
|
text += ",";
|
||||||
|
text += QString::number(customX());
|
||||||
|
text += ",";
|
||||||
|
text += QString::number(customY());
|
||||||
|
}
|
||||||
text += ")";
|
text += ")";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -133,6 +142,9 @@ void Action::loadSettings(QSettings& settings)
|
||||||
setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt());
|
setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt());
|
||||||
setActiveOnRelease(settings.value("activeOnRelease", false).toBool());
|
setActiveOnRelease(settings.value("activeOnRelease", false).toBool());
|
||||||
setHaveScreens(settings.value("hasScreens", false).toBool());
|
setHaveScreens(settings.value("hasScreens", false).toBool());
|
||||||
|
setHasCustomPosition(settings.value("hasCustomPosition", false).toBool());
|
||||||
|
setCustomX(settings.value("customX", 0).toInt());
|
||||||
|
setCustomY(settings.value("customY", 0).toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Action::saveSettings(QSettings& settings) const
|
void Action::saveSettings(QSettings& settings) const
|
||||||
|
@ -153,6 +165,9 @@ void Action::saveSettings(QSettings& settings) const
|
||||||
settings.setValue("lockCursorToScreen", lockCursorMode());
|
settings.setValue("lockCursorToScreen", lockCursorMode());
|
||||||
settings.setValue("activeOnRelease", activeOnRelease());
|
settings.setValue("activeOnRelease", activeOnRelease());
|
||||||
settings.setValue("hasScreens", haveScreens());
|
settings.setValue("hasScreens", haveScreens());
|
||||||
|
settings.setValue("hasCustomPosition", hasCustomPosition());
|
||||||
|
settings.setValue("customX", customX());
|
||||||
|
settings.setValue("customY", customY());
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream& operator<<(QTextStream& outStream, const Action& action)
|
QTextStream& operator<<(QTextStream& outStream, const Action& action)
|
||||||
|
|
|
@ -72,6 +72,15 @@ class Action
|
||||||
bool haveScreens() const { return m_HasScreens; }
|
bool haveScreens() const { return m_HasScreens; }
|
||||||
void setHaveScreens(bool b) { m_HasScreens = b; }
|
void setHaveScreens(bool b) { m_HasScreens = b; }
|
||||||
|
|
||||||
|
bool hasCustomPosition() const { return m_hasCustomPosition; }
|
||||||
|
void setHasCustomPosition(bool b) { m_hasCustomPosition = b; }
|
||||||
|
|
||||||
|
int customX() const { return m_customX; }
|
||||||
|
void setCustomX(int x) { m_customX = x; }
|
||||||
|
|
||||||
|
int customY() const { return m_customY; }
|
||||||
|
void setCustomY(int y) { m_customY = y; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KeySequence m_KeySequence;
|
KeySequence m_KeySequence;
|
||||||
int m_Type;
|
int m_Type;
|
||||||
|
@ -81,6 +90,9 @@ class Action
|
||||||
int m_LockCursorMode;
|
int m_LockCursorMode;
|
||||||
bool m_ActiveOnRelease;
|
bool m_ActiveOnRelease;
|
||||||
bool m_HasScreens;
|
bool m_HasScreens;
|
||||||
|
bool m_hasCustomPosition;
|
||||||
|
int m_customX;
|
||||||
|
int m_customY;
|
||||||
|
|
||||||
static const char* m_ActionTypeNames[];
|
static const char* m_ActionTypeNames[];
|
||||||
static const char* m_SwitchDirectionNames[];
|
static const char* m_SwitchDirectionNames[];
|
||||||
|
|
|
@ -73,6 +73,11 @@ ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize coordinate controls
|
||||||
|
m_pCheckBoxCustomPosition->setChecked(m_Action.hasCustomPosition());
|
||||||
|
m_pSpinBoxX->setValue(m_Action.customX());
|
||||||
|
m_pSpinBoxY->setValue(m_Action.customY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionDialog::accept()
|
void ActionDialog::accept()
|
||||||
|
@ -93,6 +98,23 @@ void ActionDialog::accept()
|
||||||
m_Action.setSwitchDirection(m_pComboSwitchInDirection->currentIndex());
|
m_Action.setSwitchDirection(m_pComboSwitchInDirection->currentIndex());
|
||||||
m_Action.setLockCursorMode(m_pComboLockCursorToScreen->currentIndex());
|
m_Action.setLockCursorMode(m_pComboLockCursorToScreen->currentIndex());
|
||||||
m_Action.setActiveOnRelease(m_pRadioHotkeyReleased->isChecked());
|
m_Action.setActiveOnRelease(m_pRadioHotkeyReleased->isChecked());
|
||||||
|
|
||||||
|
// Save coordinate settings only for switchToScreen action
|
||||||
|
if (m_pButtonGroupType->checkedId() == Action::switchToScreen) {
|
||||||
|
m_Action.setHasCustomPosition(m_pCheckBoxCustomPosition->isChecked());
|
||||||
|
if (m_pCheckBoxCustomPosition->isChecked()) {
|
||||||
|
m_Action.setCustomX(m_pSpinBoxX->value());
|
||||||
|
m_Action.setCustomY(m_pSpinBoxY->value());
|
||||||
|
} else {
|
||||||
|
m_Action.setCustomX(0);
|
||||||
|
m_Action.setCustomY(0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Clear custom position for other action types
|
||||||
|
m_Action.setHasCustomPosition(false);
|
||||||
|
m_Action.setCustomX(0);
|
||||||
|
m_Action.setCustomY(0);
|
||||||
|
}
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,96 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_pCheckBoxCustomPosition">
|
||||||
|
<property name="text">
|
||||||
|
<string>Set specific position</string>
|
||||||
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout">
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="m_pLabelX">
|
||||||
|
<property name="text">
|
||||||
|
<string>X:</string>
|
||||||
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="m_pSpinBoxX">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="m_pLabelY">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y:</string>
|
||||||
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="m_pSpinBoxY">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -588,5 +678,85 @@
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_pRadioSwitchToScreen</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_pCheckBoxCustomPosition</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>291</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_pCheckBoxCustomPosition</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_pLabelX</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>50</x>
|
||||||
|
<y>330</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_pCheckBoxCustomPosition</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_pSpinBoxX</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>100</x>
|
||||||
|
<y>330</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_pCheckBoxCustomPosition</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_pLabelY</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>150</x>
|
||||||
|
<y>330</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_pCheckBoxCustomPosition</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_pSpinBoxY</receiver>
|
||||||
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>148</x>
|
||||||
|
<y>310</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>200</x>
|
||||||
|
<y>330</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -1141,8 +1141,8 @@ void Config::parseAction(ConfigReadContext& s, const std::string& name,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (name == "switchToScreen") {
|
else if (name == "switchToScreen") {
|
||||||
if (args.size() != 1) {
|
if (args.size() != 1 && args.size() != 3) {
|
||||||
throw XConfigRead(s, "syntax for action: switchToScreen(name)");
|
throw XConfigRead(s, "syntax for action: switchToScreen(name[,x,y])");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string screen = args[0];
|
std::string screen = args[0];
|
||||||
|
@ -1153,7 +1153,19 @@ void Config::parseAction(ConfigReadContext& s, const std::string& name,
|
||||||
throw XConfigRead(s, "unknown screen name in switchToScreen");
|
throw XConfigRead(s, "unknown screen name in switchToScreen");
|
||||||
}
|
}
|
||||||
|
|
||||||
action = new InputFilter::SwitchToScreenAction(m_events, screen);
|
if (args.size() == 3) {
|
||||||
|
// Parse coordinates
|
||||||
|
int x, y;
|
||||||
|
try {
|
||||||
|
x = std::stoi(args[1]);
|
||||||
|
y = std::stoi(args[2]);
|
||||||
|
} catch (const std::exception&) {
|
||||||
|
throw XConfigRead(s, "invalid coordinates in switchToScreen");
|
||||||
|
}
|
||||||
|
action = new InputFilter::SwitchToScreenAction(m_events, screen, x, y);
|
||||||
|
} else {
|
||||||
|
action = new InputFilter::SwitchToScreenAction(m_events, screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (name == "toggleScreen") {
|
else if (name == "toggleScreen") {
|
||||||
|
|
|
@ -322,6 +322,20 @@ InputFilter::LockCursorToScreenAction::perform(const Event& event)
|
||||||
InputFilter::SwitchToScreenAction::SwitchToScreenAction(IEventQueue* events,
|
InputFilter::SwitchToScreenAction::SwitchToScreenAction(IEventQueue* events,
|
||||||
const std::string& screen) :
|
const std::string& screen) :
|
||||||
m_screen(screen),
|
m_screen(screen),
|
||||||
|
m_hasCustomPosition(false),
|
||||||
|
m_x(0),
|
||||||
|
m_y(0),
|
||||||
|
m_events(events)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
InputFilter::SwitchToScreenAction::SwitchToScreenAction(IEventQueue* events,
|
||||||
|
const std::string& screen, int x, int y) :
|
||||||
|
m_screen(screen),
|
||||||
|
m_hasCustomPosition(true),
|
||||||
|
m_x(x),
|
||||||
|
m_y(y),
|
||||||
m_events(events)
|
m_events(events)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -332,15 +346,38 @@ std::string InputFilter::SwitchToScreenAction::getScreen() const
|
||||||
return m_screen;
|
return m_screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InputFilter::SwitchToScreenAction::hasCustomPosition() const
|
||||||
|
{
|
||||||
|
return m_hasCustomPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
int InputFilter::SwitchToScreenAction::getX() const
|
||||||
|
{
|
||||||
|
return m_x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int InputFilter::SwitchToScreenAction::getY() const
|
||||||
|
{
|
||||||
|
return m_y;
|
||||||
|
}
|
||||||
|
|
||||||
InputFilter::Action*
|
InputFilter::Action*
|
||||||
InputFilter::SwitchToScreenAction::clone() const
|
InputFilter::SwitchToScreenAction::clone() const
|
||||||
{
|
{
|
||||||
return new SwitchToScreenAction(*this);
|
if (m_hasCustomPosition) {
|
||||||
|
return new SwitchToScreenAction(m_events, m_screen, m_x, m_y);
|
||||||
|
} else {
|
||||||
|
return new SwitchToScreenAction(m_events, m_screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string InputFilter::SwitchToScreenAction::format() const
|
std::string InputFilter::SwitchToScreenAction::format() const
|
||||||
{
|
{
|
||||||
return barrier::string::sprintf("switchToScreen(%s)", m_screen.c_str());
|
if (m_hasCustomPosition) {
|
||||||
|
return barrier::string::sprintf("switchToScreen(%s,%d,%d)", m_screen.c_str(), m_x, m_y);
|
||||||
|
} else {
|
||||||
|
return barrier::string::sprintf("switchToScreen(%s)", m_screen.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -356,8 +393,12 @@ InputFilter::SwitchToScreenAction::perform(const Event& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// send event
|
// send event
|
||||||
Server::SwitchToScreenInfo* info =
|
Server::SwitchToScreenInfo* info;
|
||||||
Server::SwitchToScreenInfo::alloc(screen);
|
if (m_hasCustomPosition) {
|
||||||
|
info = Server::SwitchToScreenInfo::alloc(screen, m_x, m_y);
|
||||||
|
} else {
|
||||||
|
info = Server::SwitchToScreenInfo::alloc(screen);
|
||||||
|
}
|
||||||
m_events->addEvent(Event(m_events->forServer().switchToScreen(),
|
m_events->addEvent(Event(m_events->forServer().switchToScreen(),
|
||||||
event.getTarget(), info,
|
event.getTarget(), info,
|
||||||
Event::kDeliverImmediately));
|
Event::kDeliverImmediately));
|
||||||
|
|
|
@ -153,8 +153,12 @@ public:
|
||||||
class SwitchToScreenAction : public Action {
|
class SwitchToScreenAction : public Action {
|
||||||
public:
|
public:
|
||||||
SwitchToScreenAction(IEventQueue* events, const std::string& screen);
|
SwitchToScreenAction(IEventQueue* events, const std::string& screen);
|
||||||
|
SwitchToScreenAction(IEventQueue* events, const std::string& screen, int x, int y);
|
||||||
|
|
||||||
std::string getScreen() const;
|
std::string getScreen() const;
|
||||||
|
bool hasCustomPosition() const;
|
||||||
|
int getX() const;
|
||||||
|
int getY() const;
|
||||||
|
|
||||||
// Action overrides
|
// Action overrides
|
||||||
virtual Action* clone() const;
|
virtual Action* clone() const;
|
||||||
|
@ -163,6 +167,9 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_screen;
|
std::string m_screen;
|
||||||
|
bool m_hasCustomPosition;
|
||||||
|
int m_x;
|
||||||
|
int m_y;
|
||||||
IEventQueue* m_events;
|
IEventQueue* m_events;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1404,7 +1404,13 @@ Server::handleSwitchToScreenEvent(const Event& event, void*)
|
||||||
LOG((CLOG_DEBUG1 "screen \"%s\" not active", info->m_screen));
|
LOG((CLOG_DEBUG1 "screen \"%s\" not active", info->m_screen));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
jumpToScreen(index->second);
|
if (info->m_hasCustomPosition) {
|
||||||
|
// Switch to specific coordinates
|
||||||
|
switchScreen(index->second, info->m_x, info->m_y, false);
|
||||||
|
} else {
|
||||||
|
// Use default behavior - jump to last cursor position
|
||||||
|
jumpToScreen(index->second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2329,6 +2335,22 @@ Server::SwitchToScreenInfo::alloc(const std::string& screen)
|
||||||
SwitchToScreenInfo* info =
|
SwitchToScreenInfo* info =
|
||||||
(SwitchToScreenInfo*)malloc(sizeof(SwitchToScreenInfo) +
|
(SwitchToScreenInfo*)malloc(sizeof(SwitchToScreenInfo) +
|
||||||
screen.size());
|
screen.size());
|
||||||
|
info->m_hasCustomPosition = false;
|
||||||
|
info->m_x = 0;
|
||||||
|
info->m_y = 0;
|
||||||
|
strcpy(info->m_screen, screen.c_str());
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
Server::SwitchToScreenInfo*
|
||||||
|
Server::SwitchToScreenInfo::alloc(const std::string& screen, SInt32 x, SInt32 y)
|
||||||
|
{
|
||||||
|
SwitchToScreenInfo* info =
|
||||||
|
(SwitchToScreenInfo*)malloc(sizeof(SwitchToScreenInfo) +
|
||||||
|
screen.size());
|
||||||
|
info->m_hasCustomPosition = true;
|
||||||
|
info->m_x = x;
|
||||||
|
info->m_y = y;
|
||||||
strcpy(info->m_screen, screen.c_str());
|
strcpy(info->m_screen, screen.c_str());
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,12 @@ public:
|
||||||
class SwitchToScreenInfo {
|
class SwitchToScreenInfo {
|
||||||
public:
|
public:
|
||||||
static SwitchToScreenInfo* alloc(const std::string& screen);
|
static SwitchToScreenInfo* alloc(const std::string& screen);
|
||||||
|
static SwitchToScreenInfo* alloc(const std::string& screen, SInt32 x, SInt32 y);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool m_hasCustomPosition;
|
||||||
|
SInt32 m_x;
|
||||||
|
SInt32 m_y;
|
||||||
// this is a C-string; this type is a variable size structure
|
// this is a C-string; this type is a variable size structure
|
||||||
char m_screen[1];
|
char m_screen[1];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue