Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemX11.cpp')
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index b8e221f5d0c..342a3ac4413 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -186,7 +186,7 @@ GHOST_SystemX11::GHOST_SystemX11() : GHOST_System(), m_xkb_descr(NULL), m_start_
}
/* Taking care not to overflow the `tv.tv_sec * 1000`. */
- m_start_time = GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000;
+ m_start_time = uint64_t(tv.tv_sec) * 1000 + tv.tv_usec / 1000;
/* Use detectable auto-repeat, mac and windows also do this. */
int use_xkb;
@@ -279,7 +279,7 @@ GHOST_TSuccess GHOST_SystemX11::init()
return GHOST_kFailure;
}
-GHOST_TUns64 GHOST_SystemX11::getMilliSeconds() const
+uint64_t GHOST_SystemX11::getMilliSeconds() const
{
timeval tv;
if (gettimeofday(&tv, NULL) == -1) {
@@ -287,19 +287,19 @@ GHOST_TUns64 GHOST_SystemX11::getMilliSeconds() const
}
/* Taking care not to overflow the tv.tv_sec * 1000 */
- return GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000 - m_start_time;
+ return uint64_t(tv.tv_sec) * 1000 + tv.tv_usec / 1000 - m_start_time;
}
-GHOST_TUns8 GHOST_SystemX11::getNumDisplays() const
+uint8_t GHOST_SystemX11::getNumDisplays() const
{
- return GHOST_TUns8(1);
+ return uint8_t(1);
}
/**
* Returns the dimensions of the main display on this system.
* \return The dimension of the main display.
*/
-void GHOST_SystemX11::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
+void GHOST_SystemX11::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{
if (m_display) {
/* NOTE(campbell): for this to work as documented,
@@ -313,7 +313,7 @@ void GHOST_SystemX11::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
* Returns the dimensions of the main display on this system.
* \return The dimension of the main display.
*/
-void GHOST_SystemX11::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const
+void GHOST_SystemX11::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{
if (m_display) {
width = DisplayWidth(m_display, DefaultScreen(m_display));
@@ -339,10 +339,10 @@ void GHOST_SystemX11::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
* \return The new window (or 0 if creation failed).
*/
GHOST_IWindow *GHOST_SystemX11::createWindow(const char *title,
- GHOST_TInt32 left,
- GHOST_TInt32 top,
- GHOST_TUns32 width,
- GHOST_TUns32 height,
+ int32_t left,
+ int32_t top,
+ uint32_t width,
+ uint32_t height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings,
@@ -570,7 +570,7 @@ GHOST_WindowX11 *GHOST_SystemX11::findGhostWindow(Window xwind) const
return NULL;
}
-static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep)
+static void SleepTillEvent(Display *display, int64_t maxSleep)
{
int fd = ConnectionNumber(display);
fd_set fds;
@@ -649,13 +649,13 @@ bool GHOST_SystemX11::processEvents(bool waitForEvent)
GHOST_TimerManager *timerMgr = getTimerManager();
if (waitForEvent && m_dirty_windows.empty() && !XPending(m_display)) {
- GHOST_TUns64 next = timerMgr->nextFireTime();
+ uint64_t next = timerMgr->nextFireTime();
if (next == GHOST_kFireTimeNever) {
SleepTillEvent(m_display, -1);
}
else {
- GHOST_TInt64 maxSleep = next - getMilliSeconds();
+ int64_t maxSleep = next - getMilliSeconds();
if (maxSleep >= 0)
SleepTillEvent(m_display, next - getMilliSeconds());
@@ -965,9 +965,9 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
bool is_tablet = window->GetTabletData().Active != GHOST_kTabletModeNone;
if (is_tablet == false && window->getCursorGrabModeIsWarp()) {
- GHOST_TInt32 x_new = xme.x_root;
- GHOST_TInt32 y_new = xme.y_root;
- GHOST_TInt32 x_accum, y_accum;
+ int32_t x_new = xme.x_root;
+ int32_t y_new = xme.y_root;
+ int32_t x_accum, y_accum;
GHOST_Rect bounds;
/* fallback to window bounds */
@@ -1638,8 +1638,8 @@ GHOST_TSuccess GHOST_SystemX11::getButtons(GHOST_Buttons &buttons) const
}
static GHOST_TSuccess getCursorPosition_impl(Display *display,
- GHOST_TInt32 &x,
- GHOST_TInt32 &y,
+ int32_t &x,
+ int32_t &y,
Window *child_return)
{
int rx, ry, wx, wy;
@@ -1664,13 +1664,13 @@ static GHOST_TSuccess getCursorPosition_impl(Display *display,
return GHOST_kSuccess;
}
-GHOST_TSuccess GHOST_SystemX11::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const
+GHOST_TSuccess GHOST_SystemX11::getCursorPosition(int32_t &x, int32_t &y) const
{
Window child_return;
return getCursorPosition_impl(m_display, x, y, &child_return);
}
-GHOST_TSuccess GHOST_SystemX11::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
+GHOST_TSuccess GHOST_SystemX11::setCursorPosition(int32_t x, int32_t y)
{
/* This is a brute force move in screen coordinates
@@ -2136,14 +2136,14 @@ void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt,
return;
}
-GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
+char *GHOST_SystemX11::getClipboard(bool selection) const
{
Atom sseln;
Atom target = m_atom.UTF8_STRING;
Window owner;
/* from xclip.c doOut() v0.11 */
- unsigned char *sel_buf;
+ char *sel_buf;
unsigned long sel_len = 0;
XEvent evt;
unsigned int context = XCLIB_XCOUT_NONE;
@@ -2162,13 +2162,13 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
owner = XGetSelectionOwner(m_display, sseln);
if (owner == win) {
if (sseln == m_atom.CLIPBOARD) {
- sel_buf = (unsigned char *)malloc(strlen(txt_cut_buffer) + 1);
- strcpy((char *)sel_buf, txt_cut_buffer);
+ sel_buf = (char *)malloc(strlen(txt_cut_buffer) + 1);
+ strcpy(sel_buf, txt_cut_buffer);
return sel_buf;
}
else {
- sel_buf = (unsigned char *)malloc(strlen(txt_select_buffer) + 1);
- strcpy((char *)sel_buf, txt_select_buffer);
+ sel_buf = (char *)malloc(strlen(txt_select_buffer) + 1);
+ strcpy(sel_buf, txt_select_buffer);
return sel_buf;
}
}
@@ -2187,7 +2187,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
}
/* fetch the selection, or part of it */
- getClipboard_xcout(&evt, sseln, target, &sel_buf, &sel_len, &context);
+ getClipboard_xcout(&evt, sseln, target, (unsigned char **)&sel_buf, &sel_len, &context);
if (restore_this_event) {
restore_events.push_back(evt);
@@ -2228,8 +2228,8 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
if (sel_len) {
/* Only print the buffer out, and free it, if it's not empty. */
- unsigned char *tmp_data = (unsigned char *)malloc(sel_len + 1);
- memcpy((char *)tmp_data, (char *)sel_buf, sel_len);
+ char *tmp_data = (char *)malloc(sel_len + 1);
+ memcpy(tmp_data, (char *)sel_buf, sel_len);
tmp_data[sel_len] = '\0';
if (sseln == m_atom.STRING)
@@ -2242,7 +2242,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
return NULL;
}
-void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
+void GHOST_SystemX11::putClipboard(char *buffer, bool selection) const
{
Window m_window, owner;