summaryrefslogtreecommitdiff
path: root/ldmicro/lib
diff options
context:
space:
mode:
authorakshay-c2019-05-06 10:36:48 +0530
committerakshay-c2019-05-06 10:36:48 +0530
commit183053f2d67a92694cd25a4294af98055e4369e7 (patch)
tree6cf548c8f38bd17b59c1e7ee10a613978172d3d9 /ldmicro/lib
parent52b93dc4228459bd7e1204f80d983a3b29b32f1d (diff)
downloadLDmicroQt-183053f2d67a92694cd25a4294af98055e4369e7.tar.gz
LDmicroQt-183053f2d67a92694cd25a4294af98055e4369e7.tar.bz2
LDmicroQt-183053f2d67a92694cd25a4294af98055e4369e7.zip
Fixed doubleclickevent on DrawWindow and removed namespaces
Diffstat (limited to 'ldmicro/lib')
-rw-r--r--ldmicro/lib/linuxUI/linuxLD.cpp33
-rw-r--r--ldmicro/lib/linuxUI/linuxLD.h12
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp66
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h25
4 files changed, 31 insertions, 105 deletions
diff --git a/ldmicro/lib/linuxUI/linuxLD.cpp b/ldmicro/lib/linuxUI/linuxLD.cpp
index d43fd0e..9fa63c9 100644
--- a/ldmicro/lib/linuxUI/linuxLD.cpp
+++ b/ldmicro/lib/linuxUI/linuxLD.cpp
@@ -1,8 +1,6 @@
#include "linuxUI.h"
#include <iostream>
-using namespace std;
-
std::vector<HEAPRECORD> HeapRecords;
HANDLE HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
@@ -24,6 +22,14 @@ HANDLE HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
return hHeap;
}
+size_t max(size_t A, size_t B)
+{
+ if(A>B)
+ return A;
+ else
+ return B;
+}
+
LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
{
// if (hHeap == NULL)
@@ -102,7 +108,7 @@ BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
}
-HICON LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType, int cxDesired,
+/*HICON LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType, int cxDesired,
int cyDesired, UINT fuLoad)
{
HICON pixbuf;
@@ -115,26 +121,27 @@ HICON LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType, int cxDesired,
}
return pixbuf;
-}
+}*/
-void RECT_to_GDRECT(const RECT *rc, GDRECT *gdrc)
-{
- // gdrc->x = rc->left;
- // gdrc->y = rc->top;
- // gdrc->width = rc->right - rc->left;
- // gdrc->height = rc->bottom - rc->top;
-}
void OutputDebugString(char* str)
{
}
-double GetTickCount(void)
+/*double GetTickCount(void)
{
// timespec now;
// clock_gettime()
// if (clock_gettime(CLOCK_MONOTONIC, &now))
// return 0;
return 10.2;//now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0;
-}
+}*/
+double GetTickCount(void)
+{
+ timespec now;
+ if (clock_gettime(CLOCK_MONOTONIC, &now))
+ return 0;
+ return now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0;
+
+} \ No newline at end of file
diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h
index edaead8..231e499 100644
--- a/ldmicro/lib/linuxUI/linuxLD.h
+++ b/ldmicro/lib/linuxUI/linuxLD.h
@@ -11,6 +11,7 @@
#include <QSplitter>
#include <Qt>
#include <sys/mman.h>
+#include <iostream>
/// common windows referances for linux
@@ -28,7 +29,14 @@
#define LDMICRO_ICON "../ldmicro.ico"
/// Macro functions
-#define max(_A, _B) std::max(_A, _B)
+// #define max(_A, _B) std::max(_A, _B)
+
+/*#define max(_A, _B) { \
+ if((_A) > (_B)) \
+ return (_A); \
+ else \
+ return (_B); \
+ }*/
/// Typedefs
//typedef int64_t __int64;
@@ -247,4 +255,6 @@ void RECT_to_GDRECT(
void OutputDebugString(char*);
double GetTickCount(void);
+size_t max(size_t A, size_t B);
+
#endif \ No newline at end of file
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index dc2dc8b..eca0b50 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -23,10 +23,6 @@ const UINT MF_GRAYED = 1;
const UINT MF_CHECKED = 2;
const UINT MF_UNCHECKED = 3;
-/// Accelerators (keyboard shortcuts)
-GtkAccelGroup* AccelGroup;
-GClosure* closure;
-
/// ListStore
HWID view;
HTVC column;
@@ -395,59 +391,6 @@ int FillRect(HCRDC hDC, const QRect *lprc, HBRUSH hbr)
return 0;
}
-BOOL PatBlt(HWID hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD dwRop, HBRUSH hbr)
-{
- if (hdc == NULL)
- return FALSE;
-
- //cairo_set_source_rgb(hdc, hbr->red, hbr->green, hbr->blue);
- //cairo_rectangle(hdc, nXLeft, nYLeft + 20, nWidth, nHeight);
- //cairo_stroke_preserve(hdc);
-
- //cairo_fill(hdc);
-
- return TRUE;
-}
-
-BOOL GetClientRect(HWID hWid, PRECT pRect)
-{
- /* GtkAllocation allocation;
- gtk_widget_get_allocation (hWid, &allocation);
-
- pRect->top = allocation.x;
- pRect->left = allocation.y;
- pRect->right = allocation.width;
- pRect->bottom = allocation.height;
-*/
- return TRUE;
-}
-
-BOOL MoveWindow(HWID hWid, int X, int Y, int nWidth, int nHeight, BOOL bRepaint)
-{
- /* gtk_window_move(GTK_WINDOW(hWid), X, Y);
- gtk_window_resize(GTK_WINDOW(hWid), nWidth, nHeight);
-
- if (bRepaint)
- gdk_window_invalidate_rect (gtk_widget_get_window (hWid), NULL, FALSE);
- */
- return TRUE;
-}
-
-
-BOOL GetWindowRect(HWID hWid, PRECT pRect)
-{
- /*GtkAllocation allocation;
- gtk_widget_get_allocation (hWid, &allocation);
-
- pRect->top = allocation.x;
- pRect->left = allocation.y;
- pRect->right = allocation.width;
- pRect->bottom = allocation.height;
-*/
- return TRUE;
-}
-
-
UINT SetTimer(HWID hWid, UINT nIDEvent, UINT uElapse, UINT TimerID)
{
if(TimerID != NULL)
@@ -518,12 +461,3 @@ BOOL KillTimer(HWID hWid, UINT uIDEvent)
return TRUE;
}
-/*void DestroyWindow (HWID widget)
-{
- if (GTK_IS_WIDGET(widget))
- {
- gtk_widget_destroy (widget);
- }
-}*/
-
-
diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h
index 136de4e..629ede6 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -276,31 +276,6 @@ int FillRect(
const QRect *lprc,
HBRUSH hbr);
-BOOL PatBlt(
- HWID hdc,
- int nXLeft,
- int nYLeft,
- int nWidth,
- int nHeight,
- DWORD dwRop,
- HBRUSH hbr);
-
-BOOL GetClientRect(
- HWID hWid,
- PRECT lpRect);
-
-BOOL MoveWindow(
- HWID hWid,
- int X,
- int Y,
- int nWidth,
- int nHeight,
- BOOL bRepaint);
-
-BOOL GetWindowRect(
- HWID hWid,
- PRECT pRect);
-
UINT SetTimer(
HWID hWid,
UINT nIDEvent,