"stashing" stuff in a stupid way for 1.2.5
authorJavier S. Pedro <maemo@javispedro.com>
Thu, 7 Jan 2010 02:25:16 +0000 (03:25 +0100)
committerJavier S. Pedro <maemo@javispedro.com>
Thu, 7 Jan 2010 02:25:16 +0000 (03:25 +0100)
debian/changelog
gui/i18n/es_ES.po
gui/plugin.c
gui/settings.c
platform/sdli.cpp
platform/sdlv.cpp
platform/sdlv.h
platform/sdlvhildon.cpp
platform/sdlvscalers.cpp

index 58bb779..b081849 100644 (file)
@@ -1,9 +1,10 @@
 drnoksnes (1.2.5) unstable; urgency=low
 
-  * Can also build without Maemo deps now.
-  * Fixing a hangup on certain games.
+  * Changed a lot of the build system.
+  * New GUI settings layout for Fremantle.
+  * (In progress) Some experiments with hildon-desktop features.
 
- -- Javier S. Pedro <maemo@javispedro.com>  Tue, 20 Oct 2009 00:13:03 +0200
+ -- Javier S. Pedro <maemo@javispedro.com>  Thu,  7 Jan 2010 03:18:51 +0100
 
 drnoksnes (1.2.4) unstable; urgency=low
 
index 06b2701..1f70fc8 100644 (file)
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: DrNokSnes 1.2.5\n"
 "Report-Msgid-Bugs-To: maemo@javispedro.com\n"
-"POT-Creation-Date: 2010-01-03 00:53+0100\n"
-"PO-Revision-Date: 2009-12-31 03:25+0100\n"
+"POT-Creation-Date: 2010-01-07 03:08+0100\n"
+"PO-Revision-Date: 2010-01-07 03:11+0100\n"
 "Last-Translator: Javier <javier@javispedro.com>\n"
 "Language-Team: Spanish <maemo@javispedro.com>\n"
 "MIME-Version: 1.0\n"
@@ -23,87 +23,95 @@ msgstr ""
 msgid "<no rom selected>"
 msgstr "<sin rom seleccionada>"
 
-#: plugin.c:233
+#: plugin.c:234
 msgid "ROM"
 msgstr "ROM"
 
-#: plugin.c:251
+#: plugin.c:252
 msgid "Select ROM..."
 msgstr "Seleccionar ROM..."
 
-#: plugin.c:268
+#: plugin.c:269
 msgid "Sound"
 msgstr "Sonido"
 
-#: plugin.c:274
+#: plugin.c:275
 msgid "Target framerate"
 msgstr "Velocidad objetivo"
 
-#: plugin.c:291
+#: plugin.c:292
 msgid "Show while in game"
 msgstr "Mostrar durante el juego"
 
-#: plugin.c:295 plugin.c:313
+#: plugin.c:296
+#: plugin.c:314
 msgid "Turbo mode"
 msgstr "Modo Turbo"
 
-#: plugin.c:310
+#: plugin.c:311
 msgid "Enable sound"
 msgstr "Activar sonido"
 
-#: plugin.c:315
+#: plugin.c:316
 msgid "Display framerate"
 msgstr "Mostrar velocidad"
 
-#: plugin.c:334 settings.c:203
+#: plugin.c:335
+#: settings.c:206
 msgid "Accurate graphics"
 msgstr "Mejores gráficos"
 
-#: plugin.c:338
+#: plugin.c:339
 msgid "Framerate:"
 msgstr "Velocidad:"
 
-#: plugin.c:347 settings.c:228
+#: plugin.c:348
+#: settings.c:231
 msgid "No speedhacks"
 msgstr "Sin speedhacks"
 
-#: plugin.c:348 settings.c:229
+#: plugin.c:349
+#: settings.c:232
 msgid "Safe hacks only"
 msgstr "Sólo hacks seguros"
 
-#: plugin.c:349 settings.c:230
+#: plugin.c:350
+#: settings.c:233
 msgid "All speedhacks"
 msgstr "Todos los hacks"
 
-#: plugin.c:448
+#: plugin.c:449
 msgid "Settings…"
 msgstr "Ajustes…"
 
-#: plugin.c:450 plugin.c:459
+#: plugin.c:451
+#: plugin.c:460
 msgid "About…"
 msgstr "Acerca de…"
 
-#: plugin.c:458 settings.c:165
+#: plugin.c:459
+#: settings.c:168
 msgid "Settings"
 msgstr "Ajustes"
 
-#: plugin.c:467
+#: plugin.c:468
 msgid "Controls…"
 msgstr "Controles…"
 
-#: plugin.c:471
+#: plugin.c:472
 msgid "Advanced…"
 msgstr "Avanzados…"
 
-#: plugin.c:533
+#: plugin.c:534
 msgid "No ROM selected"
 msgstr "Sin ROM seleccionada"
 
-#: plugin.c:538
+#: plugin.c:539
 msgid "ROM file does not exist"
 msgstr "El archivo ROM no existe"
 
-#: controls.c:285 settings.c:184
+#: controls.c:285
+#: settings.c:187
 msgid "Controls"
 msgstr "Controles"
 
@@ -111,46 +119,56 @@ msgstr "Controles"
 msgid "Press key or…"
 msgstr "Pulsa tecla o…"
 
-#: settings.c:51
-msgid "Simple 2x zoom (fast)"
-msgstr "Zoom 2X simple (rápido)"
+#: settings.c:57
+msgid "Scale to fit"
+msgstr "Ajustar a la pantalla"
 
-#: settings.c:53 settings.c:59 settings.c:61
-msgid "Simple 2x zoom"
-msgstr "Zoom 2X simple"
-
-#: settings.c:55
+#: settings.c:58
 msgid "Fill the entire screen"
 msgstr "Rellenar toda la pantalla"
 
-#: settings.c:58
-msgid "Antialiased 2x zoom (fast)"
-msgstr "Zoom 2X suavizado (rápido)"
+#: settings.c:61
+msgid "Antialiased 2x zoom"
+msgstr "Zoom 2x suavizado"
 
+#: settings.c:62
 #: settings.c:64
-msgid "Original size"
-msgstr "Tamaño original"
+msgid "2x zoom"
+msgstr "Zoom 2x"
 
-#: settings.c:191
+#: settings.c:67
+msgid "No zoom"
+msgstr "Sin zoom"
+
+#: settings.c:194
 msgid "Player 1"
 msgstr "Jugador 1"
 
-#: settings.c:191
+#: settings.c:194
 msgid "Keyboard"
 msgstr "Teclado"
 
-#: settings.c:197
+#: settings.c:200
 msgid "Advanced"
 msgstr "Avanzado"
 
-#: settings.c:210
+#: settings.c:213
 msgid "Zoom"
 msgstr "Zoom"
 
-#: settings.c:222
+#: settings.c:225
 msgid "Speedhacks"
 msgstr "Speedhacks"
 
 #: about.c:55
 msgid "About"
 msgstr "Acerca de"
+
+#, fuzzy
+#~ msgid "2x zoom "
+#~ msgstr "Zoom 2X simple"
+#~ msgid "Simple 2x zoom (fast)"
+#~ msgstr "Zoom 2X simple (rápido)"
+#~ msgid "Original size"
+#~ msgstr "Tamaño original"
+
index 39324d4..f876901 100644 (file)
@@ -205,14 +205,15 @@ static void plugin_realized_callback(GtkWidget *widget, gpointer data)
     Atom atom;
     unsigned long val = 0;
        GtkWidget* window = gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW);
-       printf("signal called %d %d\n", GTK_WIDGET_REALIZED(window), GTK_WIDGET_VISIBLE(window));
 
-    /* Set additional property "_HILDON_STACKABLE_WINDOW", to allow the WM to manage
-       it as a stackable window. */
+    /* Set additional property "_HILDON_STACKABLE_WINDOW", 
+       to allow the WM to manage it as a stackable window. */
     display = gdk_drawable_get_display(window->window);
-    atom = gdk_x11_get_xatom_by_name_for_display (display, "_HILDON_STACKABLE_WINDOW");
-    XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window->window), atom,
-                     XA_INTEGER, 32, PropModeReplace,
+    atom = gdk_x11_get_xatom_by_name_for_display (display,
+                               "_HILDON_STACKABLE_WINDOW");
+    XChangeProperty(GDK_DISPLAY_XDISPLAY(display),
+                                GDK_WINDOW_XID(window->window),
+                                atom, XA_INTEGER, 32, PropModeReplace,
                      (unsigned char *) &val, 1);
 }
 #endif
index 4f5e694..aa37982 100644 (file)
@@ -47,21 +47,24 @@ struct scaler {
 
 static struct scaler scalers[] = {
 #if MAEMO_VERSION == 5
+#if 0
 #ifdef __arm__
-       {"hdarm2x", N_("Simple 2x zoom (fast)")},
+       {"hdarm2x", ("2x zoom")},
 #else
-       {"hdsoft2x", N_("Simple 2x zoom")},
+       {"hdsoft2x", ("2x zoom")},
 #endif /* __arm__ */
+#endif /* those above are not ready yet */
+       {"hdsq", N_("Scale to fit")},
        {"hdfill", N_("Fill the entire screen")},
 #elif MAEMO_VERSION == 4
 #ifdef __arm__
-       {"xsp", N_("Antialiased 2x zoom (fast)")},
-       {"arm2x", N_("Simple 2x zoom")},
+       {"xsp", N_("Antialiased 2x zoom")},
+       {"arm2x", N_("2x zoom")},
 #else
-       {"soft2x", N_("Simple 2x zoom")},
+       {"soft2x", N_("2x zoom")},
 #endif /* __arm__ */
 #endif /* MAEMO_VERSION */
-       {"none", N_("Original size")},
+       {"none", N_("No zoom")},
 };
 
 static GtkDialog* dialog;
index 73abc80..3026cb5 100644 (file)
@@ -70,6 +70,7 @@ static void processMouse(unsigned int x, unsigned int y, int pressed = 0)
 {
 #if CONF_EXIT_BUTTON
        /* no fullscreen escape button, we have to simulate one! */
+       /* TODO: don't hardcode sizes */
        if (Config.fullscreen && x > (800 - 100) && y < 50 && pressed > 0) {
                S9xDoAction(kActionQuit);
        }
index 66ff48a..fbd06e8 100644 (file)
@@ -133,6 +133,10 @@ static void setupVideoSurface()
        
        SDL_ShowCursor(SDL_DISABLE);
 
+#if CONF_HD
+       hdSetupFullscreen(Config.fullscreen);
+#endif
+
        scaler = sFactory->instantiate(screen, gameWidth, gameHeight);
 
        // We get pitch surface values from SDL
@@ -181,7 +185,7 @@ void S9xInitDisplay(int argc, const char ** argv)
                DIE("SDL_InitSubSystem(VIDEO): %s", SDL_GetError());
 
 #if CONF_HD
-       hd_setup();
+       hdSetup();
 #endif
 
        setupVideoSurface();
@@ -245,10 +249,10 @@ bool8_32 S9xDeinitUpdate (int width, int height, bool8_32 sixteenBit)
 
 #if CONF_EXIT_BUTTON
        if (exitRequiresDraw()) {
-               //scaler->pause();
+               scaler->pause();
                exitDraw(screen);
                SDL_Flip(screen);
-               //scaler->resume();
+               scaler->resume();
        }
 #endif
 
index b090adc..a4cfbbb 100644 (file)
@@ -42,15 +42,16 @@ extern Atom hdAtomsValues[];
 
 extern SDL_SysWMinfo WMinfo;
 
-extern void hd_setup();
-extern void hd_set_non_compositing(bool enable);
+void hdSetup();
+void hdSetNonCompositing(bool enable);
+void hdSetupFullscreen(bool enable);
 
 #endif
 
 #if defined(MAEMO) && MAEMO_VERSION >= 5
-extern void exitReset();
-extern bool exitRequiresDraw();
-extern void exitDraw(SDL_Surface* where);
+void exitReset();
+bool exitRequiresDraw();
+void exitDraw(SDL_Surface* where);
 #endif
 
 #endif
index 3438710..64d027a 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -54,7 +55,7 @@ SDL_SysWMinfo WMinfo;
 
 static void hd_setup_stackable_window();
 
-void hd_setup()
+void hdSetup()
 {
        SDL_VERSION(&WMinfo.version);
        if (!SDL_GetWMInfo(&WMinfo)) {
@@ -67,12 +68,12 @@ void hd_setup()
                XInternAtoms(display, (char**)hdAtomNames, ATOM_COUNT, True, hdAtomsValues);
 
                if (HDATOM(_HILDON_NON_COMPOSITED_WINDOW) == None) {
-                       DIE("Hildon Desktop seems not be loaded, since %s is not defined",
+                       printf("Hildon Desktop seems not be loaded, since %s is not defined",
                                "_HILDON_NON_COMPOSITED_WINDOW");
                        return;
                }
 
-               if (hgwLaunched) {
+               if (hgwLaunched || true) {
                        hd_setup_stackable_window();
                }
 
@@ -81,46 +82,25 @@ void hd_setup()
 };
 
 /** Enables or disables the Hildon NonCompositedWindow property */
-void hd_set_non_compositing(bool enable)
+void hdSetNonCompositing(bool enable)
 {
        Display *display;
-       Window xwindow;
-       XSetWindowAttributes xattr;
-       Atom atom;
+       Window window;
        int one = 1;
 
        WMinfo.info.x11.lock_func();
        display = WMinfo.info.x11.display;
-       xwindow = WMinfo.info.x11.fswindow;
+       window = WMinfo.info.x11.fswindow;
 
        if (enable) {
-               /* 
-                * The basic idea behind this is to disable the override_redirect
-                * window attribute, which SDL sets, and instead use _NET_WM_STATE
-                * to tell hildon-desktop to fullscreen the app.
-                * I am not really happy with this, which should ideally be fixed
-                * at the libsdl level, but seems to work.
-                * As soon as the window is managed by Hildon-Desktop again, set for it
-                * not to be composited.
-                */
-               XUnmapWindow(display, xwindow);
-               xattr.override_redirect = False;
-               XChangeWindowAttributes(display, xwindow, CWOverrideRedirect, &xattr);
-
-               atom = HDATOM(_NET_WM_STATE_FULLSCREEN);
-               XChangeProperty(display, xwindow, HDATOM(_NET_WM_STATE),
-                       XA_ATOM, 32, PropModeReplace,
-                       (unsigned char *) &atom, 1);
-
-               XChangeProperty(display, xwindow, HDATOM(_HILDON_NON_COMPOSITED_WINDOW),
+               XUnmapWindow(display, window);
+               XChangeProperty(display, window, HDATOM(_HILDON_NON_COMPOSITED_WINDOW),
                        XA_INTEGER, 32, PropModeReplace,
                        (unsigned char *) &one, 1);
-               XMapWindow(display, xwindow);
+               XMapWindow(display, window);
        } else {
-               xattr.override_redirect = True;
-               XDeleteProperty(display, xwindow,
+               XDeleteProperty(display, window,
                        HDATOM(_HILDON_NON_COMPOSITED_WINDOW));
-               XChangeWindowAttributes(display, xwindow, CWOverrideRedirect, &xattr);
        }
 
        WMinfo.info.x11.unlock_func();
@@ -194,10 +174,13 @@ static void hd_setup_stackable_window()
 {
        Display *display;
        Window window;
-       Atom atom = HDATOM(_NET_WM_WINDOW_TYPE_NORMAL);
+       Atom atom;
        XWMHints *hints;
+       XClassHint *chint;
+       XSetWindowAttributes xattr;
        int one = 1;
 
+#if 0
        WMinfo.info.x11.lock_func();
        display = WMinfo.info.x11.display;
 
@@ -209,31 +192,55 @@ static void hd_setup_stackable_window()
        }
 
        hints = XGetWMHints(display, launcher);
-       hints->flags &= WindowGroupHint;
+       //hints->input = True;
+       hints->flags = (hints->flags & WindowGroupHint)/* | InputHint*/;
+       
+       chint = XAllocClassHint();
+       chint->res_name = chint->res_class = strdup("drnoksnes");
 
-       window = WMinfo.info.x11.wmwindow;
+       window = WMinfo.info.x11.fswindow;
        XSetTransientForHint(display, window, launcher);
        XSetWMHints(display, window, hints);
+       XSetClassHint(display, window, chint);
+       atom = HDATOM(_NET_WM_WINDOW_TYPE_NORMAL);
        XChangeProperty(display, window, HDATOM(_NET_WM_WINDOW_TYPE),
                XA_ATOM, 32, PropModeReplace,
                (unsigned char *) &atom, 1);
-       XChangeProperty(display, window, HDATOM(_HILDON_STACKABLE_WINDOW),
-               XA_INTEGER, 32, PropModeReplace,
-               (unsigned char *) &one, 1);
-
-       window = WMinfo.info.x11.fswindow;
-       XSetTransientForHint(display, window, launcher);
-       XSetWMHints(display, window, hints);
-       XChangeProperty(display, window, HDATOM(_NET_WM_WINDOW_TYPE),
+       xattr.override_redirect = False;
+       XChangeWindowAttributes(display, window, CWOverrideRedirect, &xattr);
+       atom = HDATOM(_NET_WM_STATE_FULLSCREEN);
+       XChangeProperty(display, window, HDATOM(_NET_WM_STATE),
                XA_ATOM, 32, PropModeReplace,
                (unsigned char *) &atom, 1);
        XChangeProperty(display, window, HDATOM(_HILDON_STACKABLE_WINDOW),
                XA_INTEGER, 32, PropModeReplace,
                (unsigned char *) &one, 1);
 
+       free(chint->res_name);
+       XFree(chint);
        XFree(hints);
 
        WMinfo.info.x11.unlock_func();
+#endif
+}
+
+void hdSetupFullscreen(bool enable)
+{
+       Display *display = WMinfo.info.x11.display;
+       Window window = WMinfo.info.x11.wmwindow;
+
+#if 0
+       WMinfo.info.x11.lock_func();
+
+       /* So we hide the SDL nonfullscreen window when in fullscreen mode. */
+       if (enable) {
+               XUnmapWindow(display, window);
+       } else {
+               XMapWindow(display, window);
+       }
+
+       WMinfo.info.x11.unlock_func();
+#endif
 }
 
 #endif
index ee29992..b4b7710 100644 (file)
@@ -627,13 +627,13 @@ class HDDummy : public DummyScaler
        HDDummy(SDL_Surface* screen, int w, int h)
        : DummyScaler(screen, w, h)
        {
-               hd_set_non_compositing(true);
+               hdSetNonCompositing(true);
        }
        
 public:
        ~HDDummy()
        {
-               hd_set_non_compositing(false);
+               hdSetNonCompositing(false);
        };
 
        class Factory : public ScalerFactory
@@ -668,13 +668,13 @@ class HDSW : public SWScaler
        HDSW(SDL_Surface* screen, int w, int h)
        : SWScaler(screen, w, h)
        {
-               hd_set_non_compositing(true);
+               hdSetNonCompositing(true);
        }
        
 public:
        ~HDSW()
        {
-               hd_set_non_compositing(false);
+               hdSetNonCompositing(false);
        };
 
        class Factory : public ScalerFactory
@@ -710,13 +710,13 @@ class HDARM : public ARMScaler
        HDARM(SDL_Surface* screen, int w, int h)
        : ARMScaler(screen, w, h)
        {
-               hildon_set_non_compositing(true);
+               hdSetNonCompositing(true);
        }
        
 public:
        ~HDARM()
        {
-               hildon_set_non_compositing(false);
+               hdSetNonCompositing(false);
        };
 
        class Factory : public ScalerFactory