Hi Christophe,

Christophe CURIS schreef:
The Window Inspector is used to let user change the list of attributes for
a window. This list of attributes was defined through many hard-coded
things; by defining an array with everything at the beginning of the file
it is easier to maintain (the code is simpler because it is more generic)
and to make it evolve.

Signed-off-by: Christophe CURIS <[email protected]>
---
  src/winspector.c | 347 ++++++++++++++++++++++++++-----------------------------
  1 file changed, 163 insertions(+), 184 deletions(-)

diff --git a/src/winspector.c b/src/winspector.c
index 78b5cd0..8413836 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -60,6 +60,56 @@
  #define UPDATE_DEFAULTS               1
  #define IS_BOOLEAN            2
+
+static const struct {
+       const char *key_name;
+       WWindowAttributes flag;
+       const char *caption;
+       const char *description;
+} window_attribute[] = {
+       { "NoTitlebar", { .no_titlebar = 1 }, M_("Disable titlebar"),
(...)

Gettext doesn't use the M_("...") strings currently. M_ could be added as a prefix, or the strings be changed to N_, ofcourse... (?)

wmaker-crm-c2290ef $ grep -r 'M_("'
src/rootmenu.c: wMenuAddCallback(menu, M_("XTerm"), execCommand, "xterm");
src/rootmenu.c: wMenuAddCallback(menu, M_("rxvt"), execCommand, "rxvt");
src/winspector.c: { "NoTitlebar", { .no_titlebar = 1 }, M_("Disable titlebar"),
src/winspector.c:         M_("Remove the titlebar of this window.\n"
src/winspector.c: { "NoResizebar", { .no_resizebar = 1 }, M_("Disable resizebar"),
src/winspector.c:         M_("Remove the resizebar of this window.") },
src/winspector.c: { "NoCloseButton", { .no_close_button = 1 }, M_("Disable close button"), src/winspector.c: M_("Remove the `close window' button of this window.") }, src/winspector.c: { "NoMiniaturizeButton", { .no_miniaturize_button = 1 }, M_("Disable miniaturize button"), src/winspector.c: M_("Remove the `miniaturize window' button of the window.") }, src/winspector.c: { "NoBorder", { .no_border = 1 }, M_("Disable border"), src/winspector.c: M_("Remove the 1 pixel black border around the window.") }, src/winspector.c: { "KeepOnTop", { .floating = 1 }, M_("Keep on top (floating)"), src/winspector.c: M_("Keep the window over other windows, not allowing\n" src/winspector.c: { "KeepOnBottom", { .sunken = 1 }, M_("Keep at bottom (sunken)"),
src/winspector.c:         M_("Keep the window under all other windows.") },
src/winspector.c: { "Omnipresent", { .omnipresent = 1 }, M_("Omnipresent"),
src/winspector.c:         M_("Make window present in all workspaces.") },
src/winspector.c: { "StartMiniaturized", { .start_miniaturized = 1 }, M_("Start miniaturized"), src/winspector.c: M_("Make the window be automatically miniaturized when it's\n" src/winspector.c: { "StartMaximized", { .start_maximized = 1 }, M_("Start maximized"), src/winspector.c: M_("Make the window be automatically maximized when it's\n" src/winspector.c: { "FullMaximize", { .full_maximize = 1 }, M_("Full screen maximization"), src/winspector.c: M_("Make the window use the whole screen space when it's\n" src/winspector.c: { "NoKeyBindings", { .no_bind_keys = 1 }, M_("Do not bind keyboard shortcuts"), src/winspector.c: M_("Do not bind keyboard shortcuts from Window Maker\n" src/winspector.c: { "NoMouseBindings", { .no_bind_mouse = 1 }, M_("Do not bind mouse clicks"), src/winspector.c: M_("Do not bind mouse actions, such as `Alt'+drag\n" src/winspector.c: { "SkipWindowList", { .skip_window_list = 1 }, M_("Do not show in the window list"), src/winspector.c: M_("Do not list the window in the window list menu.") }, src/winspector.c: { "SkipSwitchPanel", { .skip_switchpanel = 1 }, M_("Do not show in the switch panel"), src/winspector.c: M_("Do not include in switch panel while cycling windows.") }, src/winspector.c: { "Unfocusable", { .no_focusable = 1 }, M_("Do not let it take focus"), src/winspector.c: M_("Do not let the window take keyboard focus when you\n" src/winspector.c: { "KeepInsideScreen", { .dont_move_off = 1 }, M_("Keep inside screen"), src/winspector.c: M_("Do not allow the window to move itself completely\n" src/winspector.c: { "NoHideOthers", { .no_hide_others = 1 }, M_("Ignore 'Hide Others'"),
src/winspector.c:         M_("Do not hide the window when issuing the\n"
src/winspector.c: { "DontSaveSession", { .dont_save_session = 1 }, M_("Ignore 'Save Session'"), src/winspector.c: M_("Do not save the associated application in the\n" src/winspector.c: { "EmulateAppIcon", { .emulate_appicon = 1 }, M_("Emulate application icon"), src/winspector.c: M_("Make this window act as an application that provides\n" src/winspector.c: { "FocusAcrossWorkspace", { .focus_across_wksp = 1 }, M_("Focus across workspaces"), src/winspector.c: M_("Allow Window Maker to switch workspace to satisfy\n" src/winspector.c: { "NoMiniaturizable", { .no_miniaturizable = 1 }, M_("Do not let it be minimized"), src/winspector.c: M_("Do not let the window of this application be\n" src/winspector.c: ,{ "NoLanguageButton", { .no_language_button = 1 }, M_("Disable language button"), src/winspector.c: M_("Remove the `toggle language' button of the window.") } src/winspector.c: { "StartHidden", { .start_hidden = 1 }, M_("Start hidden"), src/winspector.c: M_("Automatically hide application when it's started.") }, src/winspector.c: { "NoAppIcon", { .no_appicon = 1 }, M_("No application icon"), src/winspector.c: M_("Disable the application icon for the application.\n" src/winspector.c: { "SharedAppIcon", { .shared_appicon = 1 }, M_("Shared application icon"), src/winspector.c: M_("Use a single shared application icon for all of\n"


Kind regards,

--
[alwin]



--
To unsubscribe, send mail to [email protected].

Reply via email to