Skip to content

Commit d36da34

Browse files
committed
Solved issues on older GTK3 Ubuntu 12/14/16 build 3744, v.1.2.2
1 parent 30f218d commit d36da34

22 files changed

+562
-301
lines changed

prj/CMakeCompilers.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
266266

267267
# Warnings
268268
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -std=c99 -fPIE")
269-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -fPIE")
269+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++98 -fPIE")
270270

271271
# Host architecture
272272
set(HOST_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR})
@@ -296,7 +296,9 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
296296
if (CMAKE_ARCHITECTURE MATCHES "i386")
297297
set(NAPPGUI_ARCH x86)
298298
set(IDE_PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
299-
299+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long")
300+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
301+
300302
elseif (CMAKE_ARCHITECTURE MATCHES "x64")
301303
set(NAPPGUI_ARCH x64)
302304
set(IDE_PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")

prj/CMakeGCCheckVersion.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ macro(checkGCCVersion)
2525
set(GCC_VERSION "gcc8")
2626
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
2727
set(GCC_VERSION "gcc9")
28-
else()
28+
elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
2929
set(GCC_VERSION "gcc10")
30+
else()
31+
set(GCC_VERSION "gcc11")
3032
endif()
3133

3234
else()

prj/CMakeSDKVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set(NAPPGUI_MAJOR 1)
66
set(NAPPGUI_MINOR 2)
7-
set(NAPPGUI_REVISION 1)
7+
set(NAPPGUI_REVISION 2)
88

99
# Build version
1010
#------------------------------------------------------------------------------

prj/build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3657
1+
3744

src/draw2d/gtk3/dctx_gtk.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -165,31 +165,6 @@ void dctx_size(const DCtx *ctx, uint32_t *width, uint32_t *height)
165165
cassert_no_null(ctx);
166166
ptr_assign(width, ctx->width);
167167
ptr_assign(height, ctx->height);
168-
169-
// if (ctx->widget != NULL)
170-
// {
171-
// GtkAllocation alloc;
172-
//
173-
//#if GTK_CHECK_VERSION(3, 20, 0)
174-
// gtk_widget_get_allocated_size(ctx->widget, &alloc, NULL);
175-
//#else
176-
// gtk_widget_get_allocation(ctx->widget, &alloc);
177-
//#endif
178-
// if (width != NULL)
179-
// *width = (real32_t)alloc.width;
180-
//
181-
// if (height != NULL)
182-
// *height = (real32_t)alloc.height;
183-
// }
184-
// else
185-
// {
186-
// cassert(ctx->surface != NULL);
187-
// if (width != NULL)
188-
// *width = (real32_t)cairo_image_surface_get_width(ctx->surface);
189-
//
190-
// if (height != NULL)
191-
// *height = (real32_t)cairo_image_surface_get_height(ctx->surface);
192-
// }
193168
}
194169

195170
/*---------------------------------------------------------------------------*/

src/draw2d/gtk3/osimage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static __INLINE bool_t i_is_gif_buffer(const byte_t *data, const uint32_t size)
183183

184184
/*---------------------------------------------------------------------------*/
185185

186-
#if (GDK_PIXBUF_MAJOR < 2 || (GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR < 4))
186+
#if (GDK_PIXBUF_MAJOR < 2 || (GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR < 28))
187187
#include "bfile.h"
188188
#include "hfile.h"
189189
#endif

src/osbs/osbs.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef enum _file_seek_t
102102
{
103103
ekSEEKSET = 1,
104104
ekSEEKCUR,
105-
ekSEEKEND,
105+
ekSEEKEND
106106
} file_seek_t;
107107

108108
typedef enum _ferror_t

src/osbs/win/bproc.c

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,11 @@ bool_t bproc_finish(Proc *proc, uint32_t *code)
245245

246246
/*---------------------------------------------------------------------------*/
247247

248-
bool_t bproc_read(Proc *proc, byte_t *data, const uint32_t size, uint32_t *rsize, perror_t *error)
248+
static bool_t i_read_pipe(HANDLE pipe, byte_t *data, const uint32_t size, uint32_t *rsize, perror_t *error)
249249
{
250250
DWORD lrsize;
251251
BOOL ok;
252-
cassert_no_null(proc);
253-
ok = ReadFile(proc->pipes[STDOUT_READ_PARENT], (LPVOID)data, (DWORD)size, &lrsize, NULL);
252+
ok = ReadFile(pipe, (LPVOID)data, (DWORD)size, &lrsize, NULL);
254253
if (ok == TRUE)
255254
{
256255
if (lrsize > 0)
@@ -285,21 +284,16 @@ bool_t bproc_read(Proc *proc, byte_t *data, const uint32_t size, uint32_t *rsize
285284

286285
/*---------------------------------------------------------------------------*/
287286

287+
bool_t bproc_read(Proc *proc, byte_t *data, const uint32_t size, uint32_t *rsize, perror_t *error)
288+
{
289+
return i_read_pipe(proc->pipes[STDOUT_READ_PARENT], data, size, rsize, error);
290+
}
291+
292+
/*---------------------------------------------------------------------------*/
293+
288294
bool_t bproc_eread(Proc *proc, byte_t *data, const uint32_t size, uint32_t *rsize, perror_t *error)
289295
{
290-
DWORD lrsize;
291-
BOOL ok;
292-
cassert_no_null(proc);
293-
ok = ReadFile(proc->pipes[STDERR_READ_PARENT], (LPVOID)data, (DWORD)size, &lrsize, NULL);
294-
ptr_assign(rsize, (uint32_t)lrsize);
295-
if (error != NULL)
296-
{
297-
if (ok == TRUE)
298-
*error = ekPOK;
299-
else
300-
*error = ekPPIPE;
301-
}
302-
return (bool_t)ok;
296+
return i_read_pipe(proc->pipes[STDERR_READ_PARENT], data, size, rsize, error);
303297
}
304298

305299
/*---------------------------------------------------------------------------*/
@@ -327,16 +321,28 @@ bool_t bproc_write(Proc *proc, const byte_t *data, const uint32_t size, uint32_t
327321

328322
bool_t bproc_read_close(Proc *proc)
329323
{
330-
unref(proc);
331-
return TRUE;
324+
cassert_no_null(proc);
325+
if (proc->pipes[STDOUT_READ_PARENT] != NULL)
326+
{
327+
CloseHandle(proc->pipes[STDOUT_READ_PARENT]);
328+
proc->pipes[STDOUT_READ_PARENT] = NULL;
329+
return TRUE;
330+
}
331+
return FALSE;
332332
}
333333

334334
/*---------------------------------------------------------------------------*/
335335

336336
bool_t bproc_eread_close(Proc *proc)
337337
{
338-
unref(proc);
339-
return TRUE;
338+
cassert_no_null(proc);
339+
if (proc->pipes[STDERR_READ_PARENT] != NULL)
340+
{
341+
CloseHandle(proc->pipes[STDERR_READ_PARENT]);
342+
proc->pipes[STDERR_READ_PARENT] = NULL;
343+
return TRUE;
344+
}
345+
return FALSE;
340346
}
341347

342348
/*---------------------------------------------------------------------------*/

src/osgui/gtk3/osbutton.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ OSButton *osbutton_create(const button_flag_t flags)
117117
case ekBTPUSH:
118118
widget = gtk_button_new();
119119
focus_widget = widget;
120-
//_oscontrol_set_css(widget, "button {padding-left:4px;padding-right:4px;padding-top:3px;padding-bottom:3px;min-height:10px;}");
121120
break;
122121

123122
case ekBTFLAT:
@@ -238,8 +237,6 @@ void osbutton_image(OSButton *button, const Image *image)
238237
{
239238
const char_t *icon_name = _osgui_register_icon(image);
240239
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(button->control.widget), icon_name);
241-
//GtkWidget *icon = gtk_image_new_from_pixbuf((GdkPixbuf*)image_native(image));
242-
//gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button->control.widget), icon);
243240
break;
244241
}
245242

0 commit comments

Comments
 (0)