Skip to content

Commit

Permalink
Gtk: Switch codebase to gtkmm.
Browse files Browse the repository at this point in the history
GTK: Remove support for GTK+ 2.0.

GTK 3 is stable and widespread enough now.

GTK: Rearrange headers to eliminate gtk_s9xcore.h

Gtk: Initial gtkmm conversion work.

Gtk: More gtkmm conversion and bug fixing.

Gtk: More gtkmm fixes.

Gtk: More Fixes

OpenGL no longer creates a second window.
Accelerators are fixed.

Gtk: More fixes

Removed GLX context dependency on Gtk.

Gtk: Fix formatting.

Gtk: Remove a #pragma once
  • Loading branch information
bearoso committed Jul 17, 2020
1 parent 3c3ea98 commit e17ff69
Show file tree
Hide file tree
Showing 51 changed files with 3,053 additions and 4,704 deletions.
25 changes: 6 additions & 19 deletions gtk/meson.build
Expand Up @@ -23,29 +23,17 @@ args += [ '-DDATADIR="' + appdatadir + '"', '-DSNES9XLOCALEDIR="' + localedir +
subdir('data')
subdir('po')

glib_dep = dependency('glib-2.0', version: '> 2.28')
gthread_dep = dependency('gthread-2.0', version: '>= 2.6')
gobject_dep = dependency('gobject-2.0', version: '>= 2.6')
sdl2_dep = dependency('sdl2')

deps += [ glib_dep, gthread_dep, gobject_dep, sdl2_dep ]
deps += sdl2_dep

c_compiler = meson.get_compiler('c')

if c_compiler.version().version_compare('>=7.0.0') and c_compiler.get_id() == 'gcc'
args += '-Wno-format-truncation'
endif

if get_option('gtk3') and not get_option('gtk2')
message('Building with GTK+-3.0')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22')
gtk_ver = 3
else
message('Building with GTK+-2.0')
gtk_dep = dependency('gtk+-2.0', version: '>= 2.16')
gtk_ver = 2
endif

gtk_dep = dependency('gtkmm-3.0', version: '>= 3.22')
deps += gtk_dep

x11_dep = c_compiler.find_library('X11')
Expand Down Expand Up @@ -125,7 +113,7 @@ if slang and opengl
endif

wayland = get_option('wayland')
if wayland and gtk_ver == 3
if wayland
wayland_dep = dependency('wayland-egl', required: false)

if wayland_dep.found()
Expand Down Expand Up @@ -320,7 +308,7 @@ srcs += [
'../filter/snes_ntsc.h',
'../filter/snes_ntsc_impl.h',
'../filter/snes_ntsc.c',
'src/gtk_2_3_compat.h',
'src/gtk_compat.h',
'src/gtk_sound_driver_sdl.h',
'src/gtk_sound_driver_sdl.cpp',
'../fxinst.cpp',
Expand Down Expand Up @@ -405,7 +393,7 @@ libjma_srcs = [
libjma = static_library('jma',
libjma_srcs,
c_args: args,
cpp_args: [args, '-fexceptions'],
cpp_args: args,
include_directories: include_directories(includes))

sourcify = executable('sourcify', 'src/sourcify.c', native: true)
Expand All @@ -418,7 +406,7 @@ snes9x_gtk = executable('snes9x-gtk',
srcs,
gtk_snes9x_ui_cpp,
c_args: args,
cpp_args: [args, '-fno-exceptions', '-fno-rtti'],
cpp_args: args,
dependencies: deps,
include_directories: include_directories(includes),
link_with: libjma,
Expand All @@ -431,7 +419,6 @@ summary = [
' appdatadir: ' + appdatadir,
' localedir: ' + localedir,
'[Options] Build type: ' + get_option('buildtype'),
' GTK+ version: ' + gtk_ver.to_string(),
' Wayland: ' + wayland.to_string(),
' OpenGL: ' + opengl.to_string(),
' slang shaders: ' + slang.to_string(),
Expand Down
2 changes: 0 additions & 2 deletions gtk/meson_options.txt
Expand Up @@ -11,8 +11,6 @@ option('xbrz', type: 'boolean', value: true, description: 'Enable th
option('zlib', type: 'boolean', value: true, description: 'Enable gzip compression')
option('system-zip', type: 'boolean', value: true, description: 'Build using system minizip library')
option('screenshot', type: 'boolean', value: true, description: 'Enable screenshots')
option('gtk3', type: 'boolean', value: true, description: 'Build with GTK+ 3.0 as the toolkit')
option('wayland', type: 'boolean', value: true, description: 'Build support for Wayland')
option('gtk2', type: 'boolean', value: false, description: 'Build with GTK+ 2.0 as the toolkit')
option('dangerous-hacks', type: 'boolean', value: false, description: 'Allow dangerous hacks to be enabled')
option('appdatadir', type: 'string' , value: '', description: 'Snes9x-only data directory (default: datadir/snes9x)')
6 changes: 4 additions & 2 deletions gtk/src/background_particles.h
@@ -1,4 +1,5 @@
#pragma once
#ifndef __BACKGROUND_PARTICLES_H
#define __BACKGROUND_PARTICLES_H
#include <vector>
#include <list>
#include <cstdint>
Expand Down Expand Up @@ -49,4 +50,5 @@ class Particles
uint16_t color_table[32];
};

} // namespace Background
} // namespace Background
#endif // __BACKGROUND_PARTICLES_H
60 changes: 0 additions & 60 deletions gtk/src/gtk_2_3_compat.h

This file was deleted.

0 comments on commit e17ff69

Please sign in to comment.