diff --git a/Jamconfig.in b/Jamconfig.in index 002eb7d..d814fcc 100644 --- a/Jamconfig.in +++ b/Jamconfig.in @@ -120,6 +120,9 @@ X_LIBS ?= @X_LIBS@ ; X_PRE_LIBS ?= @X_PRE_LIBS@ ; X_EXTRA_LIBS ?= @X_EXTRA_LIBS@ ; +# solo XKB extension library +XKB_LIBS ?= @XKB_LIBS@ ; + # curl libraries CURL_CFLAGS ?= @CURL_CFLAGS@ ; CURL_LIBS ?= @CURL_LIBS@ ; diff --git a/configure.in b/configure.in index 34868b6..35197a6 100644 --- a/configure.in +++ b/configure.in @@ -212,6 +212,36 @@ fi dnl emits PTHREAD_CFLAGS and PTHREAD_LIBS ACX_PTHREAD +AC_MSG_CHECKING([for XKB extension files]) +ac_save_CFLAGS="$CFLAGS" +ac_save_LIBS="$LIBS" +CFLAGS="$CFLAGS $X_CFLAGS" +LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lxkbfile" + +AC_LANG_SAVE +AC_LANG_C +AC_TRY_LINK([ + #include + #include + #include +],[ + FILE *fd = fopen("/some/file", "r"); + XkbRF_RulesPtr ptr; + XkbRF_LoadRules(fd, ptr); +],[have_xkbrules=yes],[]) +AC_LANG_RESTORE + +CFLAGS="ac_save_CFLAGS" +LIBS="ac_save_LIBS" + +if test "$have_xkbrules" = "yes"; then + AC_DEFINE(HAVE_XKBRULES, 1, [Define to 1 if you have XKB extension]) + XKB_LIBS="$X_LIBS -lxkbfile" + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + EDE_CHECK_DIR(DBUS_SERVICE_DIR, [/usr/share/dbus-1/services /usr/local/share/dbus-1/services "$datarootdir/dbus-1/services"]) @@ -231,6 +261,7 @@ AC_SUBST(EDELIB_API_INDEX) AC_SUBST(CURL_CFLAGS) AC_SUBST(CURL_LIBS) AC_SUBST(LARGEFILE) +AC_SUBST(XKB_LIBS) AC_OUTPUT([ Jamconfig diff --git a/ede-about/icons/ede.xpm b/ede-about/icons/ede.xpm index b598ea5..55f6487 100644 --- a/ede-about/icons/ede.xpm +++ b/ede-about/icons/ede.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * ede_xpm[] = { +static const char *ede_xpm[] = { "48 48 351 2", " c None", ". c #979696", diff --git a/ede-autostart/ede-autostart.cpp b/ede-autostart/ede-autostart.cpp index 4535c1d..0ee7a14 100644 --- a/ede-autostart/ede-autostart.cpp +++ b/ede-autostart/ede-autostart.cpp @@ -88,7 +88,7 @@ static AppWindow* dialog_win; static Fl_Check_Browser* cbrowser; static char* get_basename(const char* path) { - char* p = strrchr(path, '/'); + char* p = (char*)strrchr(path, '/'); if(p) return (p + 1); diff --git a/ede-bug-tools/ede-crasher/icons/core.xpm b/ede-bug-tools/ede-crasher/icons/core.xpm index 31ac264..6713503 100644 --- a/ede-bug-tools/ede-crasher/icons/core.xpm +++ b/ede-bug-tools/ede-crasher/icons/core.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * core_xpm[] = { +static const char *core_xpm[] = { "16 16 103 2", " c None", ". c #FF9F10", diff --git a/ede-desktop-conf/ede-desktop-conf.cpp b/ede-desktop-conf/ede-desktop-conf.cpp index bc80dce..020f916 100644 --- a/ede-desktop-conf/ede-desktop-conf.cpp +++ b/ede-desktop-conf/ede-desktop-conf.cpp @@ -26,12 +26,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/ede-desktop/Utils.cpp b/ede-desktop/Utils.cpp index 6c71413..55e12b5 100644 --- a/ede-desktop/Utils.cpp +++ b/ede-desktop/Utils.cpp @@ -305,7 +305,7 @@ Pixmap create_mask(Fl_Image* img) { } char* get_basename(const char* path) { - char* p = strrchr(path, '/'); + char* p = (char*)strrchr(path, '/'); if(p) return (p + 1); diff --git a/ede-dialog/ede-dialog.cpp b/ede-dialog/ede-dialog.cpp index 928b0e5..8d76483 100644 --- a/ede-dialog/ede-dialog.cpp +++ b/ede-dialog/ede-dialog.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/ede-image-view/ede-image-view.cpp b/ede-image-view/ede-image-view.cpp index 595c01b..3d4e1d8 100644 --- a/ede-image-view/ede-image-view.cpp +++ b/ede-image-view/ede-image-view.cpp @@ -10,15 +10,14 @@ * See COPYING for details. */ - -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -369,7 +368,7 @@ int main (int argc, char **argv) { Fl::args(argc,argv,unknown); filename[0]='\0'; directory[0]='\0'; if (unknown==argc) - snprintf(directory, FL_PATH_MAX, getenv("HOME")); + snprintf(directory, FL_PATH_MAX, "%s", getenv("HOME")); else { if (strcmp(argv[unknown],"--help")==0) { printf(_("EImage - EDE Image Viewer\nPart of Equinox Desktop Environment (EDE).\nCopyright (c) 2000-2007 EDE Authors.\n\nThis program is licenced under terms of the\nGNU General Public Licence version 2 or newer.\nSee COPYING for details.\n\n")); @@ -379,14 +378,14 @@ int main (int argc, char **argv) { } if (fl_filename_isdir(argv[unknown])) { // Param is directory - snprintf(directory, FL_PATH_MAX, argv[unknown]); + snprintf(directory, FL_PATH_MAX, "%s", argv[unknown]); if (directory[0] == '~' && directory[1] == '/') // expand home dir snprintf (directory, FL_PATH_MAX, "%s%s", getenv("HOME"), argv[unknown]+1); else if (directory[0] != '/') // relative path snprintf (directory, FL_PATH_MAX, "%s/%s", getenv("PWD"), argv[unknown]); } else { - snprintf (filename, FL_PATH_MAX, argv[unknown]); + snprintf (filename, FL_PATH_MAX, "%s", argv[unknown]); if (filename[0] == '~' && filename[1] == '/') // expand home dir snprintf (filename, FL_PATH_MAX, "%s%s", getenv("HOME"), argv[unknown]+1); else if (filename[0] != '/') // relative filename diff --git a/ede-keyboard-conf/Jamfile b/ede-keyboard-conf/Jamfile index 5e8962b..96851e2 100644 --- a/ede-keyboard-conf/Jamfile +++ b/ede-keyboard-conf/Jamfile @@ -13,6 +13,6 @@ SubDir TOP ede-keyboard-conf ; SRC = ede-keyboard-conf.cpp ; EdeProgram ede-keyboard-conf : $(SRC) ; -LinkAgainst ede-keyboard-conf : $(X_LIBS) -lxkbfile ; +LinkAgainst ede-keyboard-conf : $(XKB_LIBS) ; TranslationStrings locale : $(SRC) ; diff --git a/ede-keyboard-conf/ede-keyboard-conf.cpp b/ede-keyboard-conf/ede-keyboard-conf.cpp index 688b625..0b7879c 100644 --- a/ede-keyboard-conf/ede-keyboard-conf.cpp +++ b/ede-keyboard-conf/ede-keyboard-conf.cpp @@ -14,6 +14,11 @@ #include #endif +#include +#include +EDELIB_NS_USING(alert) + +#ifdef HAVE_XKBRULES #include #include #include @@ -29,7 +34,6 @@ #include #include -#include #include #include #include @@ -47,7 +51,6 @@ EDELIB_NS_USING(String) EDELIB_NS_USING(Resource) EDELIB_NS_USING(file_path) EDELIB_NS_USING(run_sync) -EDELIB_NS_USING(alert) EDELIB_NS_USING(foreign_callback_call) static AppWindow *win; @@ -213,8 +216,10 @@ static void apply_chages_from_config(void) { /* TODO: this should be validated somehow */ apply_changes_on_x(buf, NULL); } +#endif /* HAVE_XKBRULES */ int main(int argc, char **argv) { +#ifdef HAVE_XKBRULES /* must be opened first */ fl_open_display(); @@ -294,5 +299,9 @@ int main(int argc, char **argv) { if(xkb_rules) XkbRF_Free(xkb_rules, True); +#else + alert(_("ede-keyboard-conf was compiled without XKB extension. Please recompile it again")); +#endif /* HAVE_XKBRULES */ + return 0; } diff --git a/ede-launch/ede-launch.cpp b/ede-launch/ede-launch.cpp index 5a572b3..fb1e9ca 100644 --- a/ede-launch/ede-launch.cpp +++ b/ede-launch/ede-launch.cpp @@ -67,7 +67,7 @@ static void help(void) { } static char* get_basename(const char* path) { - char *p = strrchr(path, '/'); + char *p = (char*)strrchr(path, '/'); if(p) return (p + 1); @@ -271,7 +271,7 @@ static void ok_cb(Fl_Widget*, void* w) { /* TODO: is 'cmd' safe after hide? */ if(in_term->value()) { char buf[128]; - char* term = getenv("TERM"); + const char* term = getenv("TERM"); /* also check if TERM get inherited from login console */ if(!term || strcmp(term, "linux") == 0) diff --git a/ede-launch/icons/run.xpm b/ede-launch/icons/run.xpm index 97a959f..2dcf566 100644 --- a/ede-launch/icons/run.xpm +++ b/ede-launch/icons/run.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * run_xpm[] = { +static const char *run_xpm[] = { "32 32 516 2", " c None", ". c #C9EFF9", diff --git a/ede-panel/Jamfile b/ede-panel/Jamfile index 0014dfd..4141a3e 100644 --- a/ede-panel/Jamfile +++ b/ede-panel/Jamfile @@ -11,7 +11,7 @@ SubDir TOP ede-panel ; # make it as library, so applets can use it too -ObjectC++Flags Netwm.cpp : -g3 -fPIC $(FLTKINCLUDE) $(EDELIBINCLUDE) ; +ObjectC++Flags Netwm.cpp : $(GLOBALFLAGS) -fPIC $(FLTKINCLUDE) $(EDELIBINCLUDE) ; StaticLibrary libnetwm : Netwm.cpp ; NETWMLIB = -L$(SUBDIR) -lnetwm ; @@ -38,7 +38,7 @@ rule PanelApplet target = $(<:S=$(SUFLIB_SHARED)) ; Main $(target) : $(>) ; - ObjectC++Flags $(>) : -fPIC $(FLTKINCLUDE) -I [ FDirName $(TOP) ede-panel ] $(EDELIBINCLUDE) ; + ObjectC++Flags $(>) : $(GLOBALFLAGS) -fPIC $(FLTKINCLUDE) -I [ FDirName $(TOP) ede-panel ] $(EDELIBINCLUDE) ; LinkAgainst $(target) : $(NETWMLIB) $(3) $(EDELIBLIB) $(EDELIB_GUI_LIB) $(FLTKLIB) $(STDLIB) ; LINKFLAGS on $(target) = $(linker_stuff) [ on $(target) return $(LINKFLAGS) ] ; diff --git a/ede-panel/applets/keyboard-layout/Jamfile b/ede-panel/applets/keyboard-layout/Jamfile index 9a4c4c2..27f56cb 100644 --- a/ede-panel/applets/keyboard-layout/Jamfile +++ b/ede-panel/applets/keyboard-layout/Jamfile @@ -10,4 +10,4 @@ SubDir TOP ede-panel applets keyboard-layout ; -PanelApplet keyboard_layout : KeyLayout.cpp : $(X_LIBS) -lxkbfile ; +PanelApplet keyboard_layout : KeyLayout.cpp : $(XKB_LIBS) ; diff --git a/ede-panel/applets/keyboard-layout/KeyLayout.cpp b/ede-panel/applets/keyboard-layout/KeyLayout.cpp index 0cdcbb9..c229e1e 100644 --- a/ede-panel/applets/keyboard-layout/KeyLayout.cpp +++ b/ede-panel/applets/keyboard-layout/KeyLayout.cpp @@ -1,5 +1,9 @@ #include "Applet.h" +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -7,9 +11,11 @@ #include /* needed for XKBrules.h */ -#include -#include -#include +#ifdef HAVE_XKBRULES +# include +# include +# include +#endif #include #include @@ -52,6 +58,7 @@ typedef list::iterator KeyLayoutListIt; static KeyLayoutList keylayout_objects; +#ifdef HAVE_XKBRULES /* Xkb does not provide this */ static void xkbrf_names_prop_free(XkbRF_VarDefsRec &vd, char *tmp) { XFree(tmp); @@ -60,6 +67,7 @@ static void xkbrf_names_prop_free(XkbRF_VarDefsRec &vd, char *tmp) { XFree(vd.options); XFree(vd.variant); } +#endif /* * any layout changes on X will be reported here, executed either via ede-keyboard-conf or @@ -113,8 +121,10 @@ KeyLayout::KeyLayout() : Fl_Button(0, 0, 30, 25) { keylayout_objects.push_back(this); /* with this, kb layout chages will be catched */ +#if HAVE_XKBRULES if(!_XA_XKB_RF_NAMES_PROP_ATOM) _XA_XKB_RF_NAMES_PROP_ATOM = XInternAtom(fl_display, _XKB_RF_NAMES_PROP_ATOM, False); +#endif Fl::add_handler(xkb_events); } @@ -156,12 +166,11 @@ void KeyLayout::update_flag(bool read_config) { } void KeyLayout::do_key_layout(void) { +#ifdef HAVE_XKBRULES char *tmp = NULL; XkbRF_VarDefsRec vd; if(XkbRF_GetNamesProp(fl_display, &tmp, &vd)) { - Fl_Image *img = NULL; - /* do nothing if layout do not exists or the same was catched */ if(!vd.layout || (curr_layout == vd.layout)) return; @@ -170,6 +179,7 @@ void KeyLayout::do_key_layout(void) { curr_layout = vd.layout; xkbrf_names_prop_free(vd, tmp); } +#endif } int KeyLayout::handle(int e) { diff --git a/ede-panel/applets/pager/Pager.cpp b/ede-panel/applets/pager/Pager.cpp index 7726a3a..b223671 100644 --- a/ede-panel/applets/pager/Pager.cpp +++ b/ede-panel/applets/pager/Pager.cpp @@ -57,7 +57,6 @@ void Pager::init_workspace_boxes(void) { int nworkspaces, curr_workspace; char **names = 0; - char nbuf[16]; nworkspaces = netwm_get_workspace_count(); curr_workspace = netwm_get_current_workspace(); diff --git a/ede-panel/applets/taskbar/Taskbar.cpp b/ede-panel/applets/taskbar/Taskbar.cpp index a1f2b7c..55dbfa3 100644 --- a/ede-panel/applets/taskbar/Taskbar.cpp +++ b/ede-panel/applets/taskbar/Taskbar.cpp @@ -76,8 +76,7 @@ void Taskbar::create_task_buttons(void) { if(nwins > 0) { TaskButton *b; - int curr_workspace = netwm_get_current_workspace(); - char *title; + int curr_workspace = netwm_get_current_workspace(); for(int i = 0; i < nwins; i++) { if(!netwm_manageable_window(wins[i])) @@ -158,7 +157,7 @@ void Taskbar::update_active_button(int xid) { for(int i = 0; i < children(); i++) { o = (TaskButton*)child(i); - if(o->get_window_xid() == xid) + if(o->get_window_xid() == (Window)xid) o->box(FL_DOWN_BOX); else o->box(FL_UP_BOX); diff --git a/ede-panel/applets/taskbar/icons/window.xpm b/ede-panel/applets/taskbar/icons/window.xpm index a02321d..a378b18 100644 --- a/ede-panel/applets/taskbar/icons/window.xpm +++ b/ede-panel/applets/taskbar/icons/window.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * window_xpm[] = { +static const char *window_xpm[] = { "16 16 57 1", " c None", ". c #BABDB6", diff --git a/ede-screensaver-conf/XScreenSaver.cpp b/ede-screensaver-conf/XScreenSaver.cpp index e471bfb..09fec49 100644 --- a/ede-screensaver-conf/XScreenSaver.cpp +++ b/ede-screensaver-conf/XScreenSaver.cpp @@ -130,7 +130,7 @@ static void min_to_time(unsigned int t, String& ret) { unsigned int hour = 0, min = 0; char buf[3]; - char* fmt; + const char* fmt; /* assure we do not get values that exceedes a day (24 * 60 = 1440) */ if(t >= 1440) { @@ -636,8 +636,8 @@ void xscreensaver_preview(int id, const char* name) { case 0: { usleep(250000); char* argv[4]; - argv[0] = "sh"; - argv[1] = "-c"; + argv[0] = (char*)"sh"; + argv[1] = (char*)"-c"; argv[2] = (char*)cmd.c_str(); argv[3] = NULL; execve("/bin/sh", argv, environ); diff --git a/ede-screensaver-conf/icons/energy.xpm b/ede-screensaver-conf/icons/energy.xpm index 1a9e331..dcdee07 100644 --- a/ede-screensaver-conf/icons/energy.xpm +++ b/ede-screensaver-conf/icons/energy.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * energy_star_xpm[] = { +static const char *energy_star_xpm[] = { "64 64 1305 2", " c None", ". c #D1EFFF", diff --git a/ede-timedate/ede-timedate.cpp b/ede-timedate/ede-timedate.cpp index 63070d6..eb474ad 100644 --- a/ede-timedate/ede-timedate.cpp +++ b/ede-timedate/ede-timedate.cpp @@ -57,7 +57,7 @@ bool time_changed, format_changed, tz_changed, date_changed; // config file for workpanel (time format) edelib::Config config_file; -char* zonetab_dir = 0; +const char* zonetab_dir = 0; // Time servers - all in one string, so that translators can easily add new servers const char* time_servers = _("International (pool.ntp.org)\nEurope (europe.pool.ntp.org)\nAsia (asia.pool.ntp.org)\nNorth America (north-america.pool.ntp.org)\nAustralia and Oceania (oceania.pool.ntp.org)"); diff --git a/ede-timedate/icons/world.xpm b/ede-timedate/icons/world.xpm index a10a317..e9950cc 100644 --- a/ede-timedate/icons/world.xpm +++ b/ede-timedate/icons/world.xpm @@ -1,5 +1,5 @@ /* XPM */ -const char *world[] = { +static const char *world[] = { "356 184 3 1", ". c #000078", "# c #007800", diff --git a/ede-timedate/icons/world2.xpm b/ede-timedate/icons/world2.xpm index d2e9353..700e7ac 100644 --- a/ede-timedate/icons/world2.xpm +++ b/ede-timedate/icons/world2.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * world2_xpm[] = { +static const char *world2_xpm[] = { "395 170 3 1", " c None", ". c #00017A", diff --git a/ede-tip/icons/hint.xpm b/ede-tip/icons/hint.xpm index 47e3bae..2b1d891 100644 --- a/ede-tip/icons/hint.xpm +++ b/ede-tip/icons/hint.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * hint_xpm[] = { +static const char *hint_xpm[] = { "118 197 174 2", " c #F1F3F5", ". c #F2F4F6", diff --git a/evoke/Xsm.cpp b/evoke/Xsm.cpp index 095136e..b7263c6 100644 --- a/evoke/Xsm.cpp +++ b/evoke/Xsm.cpp @@ -53,9 +53,9 @@ EDELIB_NS_USING(XSETTINGS_TYPE_INT) EDELIB_NS_USING(XSETTINGS_TYPE_STRING) struct ResourceMap { - char* name; - char* xresource_key; - char* xresource_klass; + const char* name; + const char* xresource_key; + const char* xresource_klass; }; /*