Skip to content

Commits on Source 3

commit 0e911a91579b5b8aa556e1588547576e26853e10
Author: Andre Miranda <andreldm@xfce.org>
Date: Sat Sep 22 17:12:50 2018 -0300
Updates for release
commit aa27334e5db6408a503092159ff77dc21cf873c4
Author: Andre Miranda <andreldm@xfce.org>
Date: Sat Sep 22 17:12:12 2018 -0300
Format previous release notes
commit ea18d17a743135d61bfaa1d7c4b8ecbe28e6c7d2
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 23:18:54 2018 -0300
Fallback to xfce_panel_plugin_save_location
commit 7c820df39ec561cfbce05050e31226e1f78517c4
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 21:51:10 2018 -0300
Use xfce_panel_plugin_lookup_rc_file (Bug #11823)
commit 6c34eee3c07529529900230d32476ac840be11af
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 21:49:34 2018 -0300
Check if each cpu is online (Bug #14641)
commit ebe93cf4581a87a72c1a109b3c89ab267c99a1ae
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 20:09:48 2018 -0300
Clean up and resolve -Wall warnings
commit 2e4031018c66efb0659bc8ef4bfd2293d212bbf3
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 20:09:13 2018 -0300
Remove gettext macro
commit b74280971461a54856097a820da8bf0451609699
Author: Andre Miranda <andreldm@xfce.org>
Date: Wed Sep 19 19:40:44 2018 -0300
Refactor: split cpufreq-linux.c
commit 527dd8a3d37604f391865a63873b5e90ff6acd30
Author: Andre Miranda <andreldm@xfce.org>
Date: Tue Sep 18 22:48:42 2018 -0300
Format source
commit 1c834a7b50e498dcf5e57899bad5ee1746914a69
Author: Sean Davis <smd.seandavis@gmail.com>
Date: Mon Sep 3 07:38:01 2018 -0400
Improved spacing (Bug #14661)
commit 838081d7717d2b2939d3a40c7b030c18224b427d
Author: Nuno Miguel <nunomgue@gmail.com>
Date: Sun Sep 2 18:34:00 2018 +0200
I18n: Update translation pt (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 0287088a7d8d6250b948e9b775e6ed837266944b
Author: Daniel Muñiz Fontoira <dani@damufo.com>
Date: Wed Aug 22 18:32:55 2018 +0200
I18n: Update translation gl (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit be61d3fc025de78e66e7d6bfa11ab33b383f1708
Author: Emanuele Petriglia <inbox@emanuelepetriglia.me>
Date: Sun Jul 15 18:32:12 2018 +0200
I18n: Update translation it (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 34004ee8eb7ea35890a536f464d4a7f5c0627354
Author: Panagiotis Mantzios <pmantzios@hotmail.com>
Date: Sat Jul 14 12:32:40 2018 +0200
I18n: Update translation el (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 9ce689f7ba762c77810afee2e9e1e31a5ef9914e
Author: Anonymous <noreply@xfce.org>
Date: Fri Jul 13 00:32:31 2018 +0200
I18n: Update translation gl (73%).
30 translated messages, 11 untranslated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 7c31af53eb2f0f300d70a41eba55aa6d213da34a
Author: Emanuele Petriglia <inbox@emanuelepetriglia.me>
Date: Thu Jul 12 12:32:00 2018 +0200
I18n: Update translation it (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 9c160c359c0139f7ae1f5f911d2569d6c4fd1479
Author: Emanuele Petriglia <inbox@emanuelepetriglia.me>
Date: Wed Jul 11 18:32:29 2018 +0200
I18n: Update translation it (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit fda44673944c6cd7e15463bd41028e0476239f23
Author: Ivica Kolić <ikoli@yahoo.com>
Date: Sun Jul 8 12:32:18 2018 +0200
I18n: Update translation hr (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 0ffde020900538fdb798a42c5af0177f39eafb86
Author: Påvel Nicklasson <pavel2@frimix.se>
Date: Mon Jul 2 18:33:50 2018 +0200
I18n: Update translation sv (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 76b34b8e8f9af0d2d7d78163d9c400a46d23fc7e
Author: Oliver Burkardt <oliver.burkardt@gmail.com>
Date: Sun Jun 24 00:32:55 2018 +0200
I18n: Update translation de (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 772041c0fbba6b3341817c65c455b5becbce7750
Author: Zmicer Turok <zmicerturok@gmail.com>
Date: Fri Jun 22 12:31:45 2018 +0200
I18n: Update translation be (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 050cde6f81ed35f3aac17a500beb51cf3d988259
Author: Theppitak Karoonboonyanan <theppitak@gmail.com>
Date: Mon Jun 18 12:31:57 2018 +0200
I18n: Update translation th (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 58b26224863bef7eea77bbd6c79503d4257007c7
Author: abuyop <abuyop@gmail.com>
Date: Wed Jun 6 18:32:03 2018 +0200
I18n: Update translation ms (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit eb43697087654945881ba18c5676a60c2adb7fa7
Author: Michael Martins <michaelfm21@gmail.com>
Date: Tue May 29 18:31:52 2018 +0200
I18n: Update translation pt_BR (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 3ac73ba902ecef1dc91666efa02e5d28ff86fa85
Author: Саша Петровић <salepetronije@gmail.com>
Date: Mon May 28 00:32:03 2018 +0200
I18n: Update translation sr (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit a401eb3f51cafe66df3f023227dfc13bea44c815
Author: Seong-ho Cho <darkcircle.0426@gmail.com>
Date: Sat May 26 12:32:21 2018 +0200
I18n: Update translation ko (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 9ab3ad421364f670014c3ee07a7a8b82549ebb99
Author: Demiray “tulliana” Muhterem <mdemiray@msn.com>
Date: Sat May 26 06:31:49 2018 +0200
I18n: Update translation tr (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit d063ce1bc6f6d8eae3a252a778105c3d2bc29fb5
Author: Anonymous <noreply@xfce.org>
Date: Fri May 25 00:31:47 2018 +0200
I18n: Update translation uk (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 71c6f843d4bddf441f82e40432b9cbd5deee8b66
Author: Anonymous <noreply@xfce.org>
Date: Thu May 24 18:31:55 2018 +0200
I18n: Update translation da (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 0983f336a715a924cb5cd7dd305c1b679940c33a
Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Date: Wed May 23 06:31:43 2018 +0200
I18n: Update translation ja (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit f6440869b5f89527ca918c3633862f7b429cd0c4
Author: Elishai Eliyahu <e1907@mm.st>
Date: Mon May 21 18:31:58 2018 +0200
I18n: Update translation he (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 50f8c083251a81dda08e52fcaaaafa836f676bec
Author: John Humphrys <john.humphrys@pm.me>
Date: Mon May 21 18:31:58 2018 +0200
I18n: Update translation en_AU (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 94a77bdc4a1639e5391d1a7b0aec12f521568970
Author: 玉堂白鹤 <yjwork@qq.com>
Date: Mon May 21 06:31:44 2018 +0200
I18n: Update translation zh_CN (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 6acba4dabe7c818d5c132cd6ecfe92b61d9849ad
Author: Enrico B <enricobe@hotmail.com>
Date: Sat May 19 18:32:06 2018 +0200
I18n: Update translation it (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 2211abbceda6ce8cdddca57348baf74e5da0d418
Author: Pjotr <pjotrvertaalt@gmail.com>
Date: Sat May 19 00:31:48 2018 +0200
I18n: Update translation nl (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 4c61078d8969bde0c50f99f5a2e2f7030639c357
Author: Anonymous <noreply@xfce.org>
Date: Sat May 19 00:31:48 2018 +0200
I18n: Update translation lt (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 0b6442cb22e1c5939a0ea1e9a5e58cdc8acd97a5
Author: Robert Antoni Buj Gelonch <rbuj@fedoraproject.org>
Date: Sat May 19 00:31:48 2018 +0200
I18n: Update translation ca (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit fdf04b6527976dcdce7afd5262a16d47350ad7f9
Author: Jeff Huang <s8321414@gmail.com>
Date: Fri May 18 18:32:52 2018 +0200
I18n: Update translation zh_TW (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 5cd9e33ca50d8fcd89d5dcbc315aef90cd2a58ae
Author: Igor <f2404@yandex.ru>
Date: Fri May 18 18:32:52 2018 +0200
I18n: Update translation ru (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit c001ba07d5d63e40c2d47c9660b7e45cd1a3048e
Author: Anonymous <noreply@xfce.org>
Date: Fri May 18 18:32:52 2018 +0200
I18n: Update translation pl (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit 01a49fba076a9114f47f4e0de98c862d59c444f1
Author: Charles Monzat <superboa@hotmail.fr>
Date: Fri May 18 18:32:52 2018 +0200
I18n: Update translation fr (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit c2f36dcf07adcee45ddb14b4c4c3716c2549acab
Author: Michal Várady <miko.vaji@gmail.com>
Date: Fri May 18 18:32:52 2018 +0200
I18n: Update translation cs (100%).
41 translated messages.
Transifex (https://www.transifex.com/xfce/public/).
commit ffc63516702015689f0e9065a1fd39448abf8f13
Author: Andre Miranda <andreldm@xfce.org>
Date: Thu May 17 22:51:48 2018 -0300
Post release tag bump
commit 5a9c8bacbb51e4068e413e0e9d09d697c496ffc0
Author: Andre Miranda <andreldm@xfce.org>
Date: Thu May 17 22:44:28 2018 -0300
......
1.2.1 (2018-09-22)
------------------
* Improved spacing in dialogs (Bug #14661)
* Check if each cpu is online (Bug #14641)
* Use xfce_panel_plugin_lookup_rc_file (Bug #11823)
* Translation updates: Belarusian, Catalan, Chinese (China), Chinese (Taiwan),
Croatian, Czech, Danish, Dutch, English (Australia), French, Galician,
German, Greek, Hebrew, Italian, Japanese, Korean, Lithuanian, Malay, Polish,
Portuguese, Portuguese (Brazil), Russian, Serbian, Swedish, Thai, Turkish,
Ukrainian
1.2.0 (2018-05-17)
------------------
* Prefer sysfs to Intel pstate in cpufreq_linux_init (Bug #13835)
* Add option to configure text color (Bug #13565)
* Translation updates:
Arabic, Asturian, Basque, Belarusian, Bulgarian, Catalan, Chinese (China),
Chinese (Taiwan), Croatian, Czech, Danish, Dutch, English (Australia),
English (United Kingdom), French, German, Greek, Hebrew, Hungarian,
Icelandic, Indonesian, Italian, Japanese, Korean, Lithuanian, Malay,
Norwegian Bokmål, Occitan, Polish, Portuguese, Portuguese (Brazil), Russian,
Serbian, Slovak, Spanish, Swedish, Thai, Turkish, Ukrainian, Uyghur
* Translation updates: Arabic, Asturian, Basque, Belarusian, Bulgarian,
Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish, Dutch,
English (Australia), English (United Kingdom), French, German, Greek, Hebrew,
Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Lithuanian,
Malay, Norwegian Bokmål, Occitan, Polish, Portuguese, Portuguese (Brazil),
Russian, Serbian, Slovak, Spanish, Swedish, Thai, Turkish, Ukrainian, Uyghur
1.1.90 (2017-05-16)
------------------
......
......@@ -541,7 +541,7 @@ AC_DEFUN([AM_NLS],
])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
# serial 11 (pkg-config-0.29.1)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
......@@ -583,7 +583,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
[m4_define([PKG_MACROS_VERSION], [0.29.1])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
......@@ -684,7 +684,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
......@@ -816,6 +816,74 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
......@@ -2174,7 +2242,7 @@ AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
......@@ -2393,8 +2461,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
......@@ -4753,8 +4821,8 @@ m4_if([$1], [],[
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
......@@ -4810,7 +4878,7 @@ m4_if([$1], [],[
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
......@@ -6198,7 +6266,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
......@@ -7115,7 +7183,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*)
cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
......@@ -7172,15 +7240,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
......@@ -7745,12 +7813,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
......@@ -7791,7 +7859,7 @@ _LT_EOF
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
......@@ -8817,8 +8885,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
......@@ -10547,7 +10615,7 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2017 Free Software
# Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
......@@ -10979,7 +11047,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2017 Free Software
# Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
......@@ -11104,7 +11172,7 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2017 Free Software Foundation, Inc.
# Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
......@@ -11113,22 +11181,22 @@ m4_define([lt_dict_filter],
# @configure_input@
# serial 4219 ltversion.m4
# serial 4221 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6.40-6ca5-dirty])
m4_define([LT_PACKAGE_REVISION], [2.4.6.40])
m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce])
m4_define([LT_PACKAGE_REVISION], [2.4.6.42])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6.40-6ca5-dirty'
macro_revision='2.4.6.40'
[macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6.42'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2017 Free Software
# Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software
# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xfce4-cpufreq-plugin 1.2.0.
# Generated by GNU Autoconf 2.69 for xfce4-cpufreq-plugin 1.2.1.
#
# Report bugs to <http://bugzilla.xfce.org>.
#
......@@ -595,8 +595,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xfce4-cpufreq-plugin'
PACKAGE_TARNAME='xfce4-cpufreq-plugin'
PACKAGE_VERSION='1.2.0'
PACKAGE_STRING='xfce4-cpufreq-plugin 1.2.0'
PACKAGE_VERSION='1.2.1'
PACKAGE_STRING='xfce4-cpufreq-plugin 1.2.1'
PACKAGE_BUGREPORT='http://bugzilla.xfce.org'
PACKAGE_URL=''
......@@ -1396,7 +1396,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures xfce4-cpufreq-plugin 1.2.0 to adapt to many kinds of systems.
\`configure' configures xfce4-cpufreq-plugin 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1467,7 +1467,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xfce4-cpufreq-plugin 1.2.0:";;
short | recursive ) echo "Configuration of xfce4-cpufreq-plugin 1.2.1:";;
esac
cat <<\_ACEOF
......@@ -1592,7 +1592,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xfce4-cpufreq-plugin configure 1.2.0
xfce4-cpufreq-plugin configure 1.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1966,7 +1966,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xfce4-cpufreq-plugin $as_me 1.2.0, which was
It was created by xfce4-cpufreq-plugin $as_me 1.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2831,7 +2831,7 @@ fi
# Define the identity of the package.
PACKAGE='xfce4-cpufreq-plugin'
VERSION='1.2.0'
VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF
......@@ -5228,8 +5228,8 @@ esac
macro_version='2.4.6.40-6ca5-dirty'
macro_revision='2.4.6.40'
macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6.42'
......@@ -6830,7 +6830,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
......@@ -8762,8 +8762,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
......@@ -9686,15 +9686,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
......@@ -10343,12 +10343,12 @@ fi
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
......@@ -10389,7 +10389,7 @@ fi
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
......@@ -11421,8 +11421,8 @@ cygwin* | mingw* | pw32* | cegcc*)
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
......@@ -11478,7 +11478,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
......@@ -15144,7 +15144,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by xfce4-cpufreq-plugin $as_me 1.2.0, which was
This file was extended by xfce4-cpufreq-plugin $as_me 1.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -15210,7 +15210,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
xfce4-cpufreq-plugin config.status 1.2.0
xfce4-cpufreq-plugin config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -12,8 +12,8 @@ dnl Version information
AC_CONFIG_MACRO_DIR([m4])
m4_define([cpufreq_version_major], [1])
m4_define([cpufreq_version_minor], [2])
m4_define([cpufreq_version_micro], [0])
m4_define([cpufreq_version_build], [c5d6bde])
m4_define([cpufreq_version_micro], [1])
m4_define([cpufreq_version_build], [0e911a9])
m4_define([cpufreq_version_tag], [])
m4_define([cpufreq_version], [cpufreq_version_major().cpufreq_version_minor().cpufreq_version_micro()ifelse(cpufreq_version_tag(), [git], [cpufreq_version_tag()-cpufreq_version_build()], [cpufreq_version_tag()])])
......
xfce4-cpufreq-plugin (1.2.1-1) unstable; urgency=medium
* New upstream version 1.2.1
-- Yves-Alexis Perez <corsac@debian.org> Sun, 23 Sep 2018 16:16:00 +0200
xfce4-cpufreq-plugin (1.2.0-1) unstable; urgency=medium
* Moved the package to git on salsa.debian.org
......
#! /bin/sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2016-02-21.11
## by inline-source v2018-07-24.06
# libtool (GNU libtool) 2.4.6.40-6ca5-dirty
# libtool (GNU libtool) 2.4.6.42-b88ce
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
......@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.4.6.40-6ca5-dirty
package_revision=2.4.6.40
VERSION=2.4.6.42-b88ce
package_revision=2.4.6.42
## ------ ##
......@@ -64,7 +64,7 @@ package_revision=2.4.6.40
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
scriptversion=2017-04-19.12; # UTC
scriptversion=2018-07-24.06; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
......@@ -72,7 +72,7 @@ scriptversion=2017-04-19.12; # UTC
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Copyright (C) 2004-2017 Bootstrap Authors
# Copyright (C) 2004-2018 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
# <https://opensource.org/license/MIT>, and GPL version 3 or later
......@@ -1497,7 +1497,7 @@ func_lt_ver ()
# This is free software. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Copyright (C) 2010-2017 Bootstrap Authors
# Copyright (C) 2010-2018 Bootstrap Authors
#
# This file is dual licensed under the terms of the MIT license
# <https://opensource.org/license/MIT>, and GPL version 3 or later
......@@ -1510,7 +1510,7 @@ func_lt_ver ()
# <https://github.com/gnulib-modules/bootstrap/issues>
# Set a version string for this script.
scriptversion=2016-03-06.01; # UTC
scriptversion=2018-07-24.06; # UTC
## ------ ##
......@@ -2171,12 +2171,12 @@ func_version ()
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
# Set a version string.
scriptversion='(GNU libtool) 2.4.6.40-6ca5-dirty'
scriptversion='(GNU libtool) 2.4.6.42-b88ce'
# func_echo ARG...
......@@ -2267,7 +2267,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname (GNU libtool) 2.4.6.40-6ca5-dirty
version: $progname (GNU libtool) 2.4.6.42-b88ce
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
......
......@@ -19,6 +19,12 @@ libcpufreq_la_LIBADD = \
libcpufreq_la_SOURCES = \
xfce4-cpufreq-plugin.h \
xfce4-cpufreq-plugin.c \
xfce4-cpufreq-linux-procfs.h \
xfce4-cpufreq-linux-procfs.c \
xfce4-cpufreq-linux-pstate.h \
xfce4-cpufreq-linux-pstate.c \
xfce4-cpufreq-linux-sysfs.h \
xfce4-cpufreq-linux-sysfs.c \
xfce4-cpufreq-linux.h \
xfce4-cpufreq-linux.c \
xfce4-cpufreq-configure.h \
......
......@@ -132,6 +132,9 @@ am__DEPENDENCIES_1 =
libcpufreq_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am_libcpufreq_la_OBJECTS = libcpufreq_la-xfce4-cpufreq-plugin.lo \
libcpufreq_la-xfce4-cpufreq-linux-procfs.lo \
libcpufreq_la-xfce4-cpufreq-linux-pstate.lo \
libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo \
libcpufreq_la-xfce4-cpufreq-linux.lo \
libcpufreq_la-xfce4-cpufreq-configure.lo \
libcpufreq_la-xfce4-cpufreq-overview.lo \
......@@ -392,6 +395,12 @@ libcpufreq_la_LIBADD = \
libcpufreq_la_SOURCES = \
xfce4-cpufreq-plugin.h \
xfce4-cpufreq-plugin.c \
xfce4-cpufreq-linux-procfs.h \
xfce4-cpufreq-linux-procfs.c \
xfce4-cpufreq-linux-pstate.h \
xfce4-cpufreq-linux-pstate.c \
xfce4-cpufreq-linux-sysfs.h \
xfce4-cpufreq-linux-sysfs.c \
xfce4-cpufreq-linux.h \
xfce4-cpufreq-linux.c \
xfce4-cpufreq-configure.h \
......@@ -496,6 +505,9 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-configure.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-procfs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-pstate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-sysfs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-overview.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcpufreq_la-xfce4-cpufreq-plugin.Plo@am__quote@
......@@ -529,6 +541,27 @@ libcpufreq_la-xfce4-cpufreq-plugin.lo: xfce4-cpufreq-plugin.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -c -o libcpufreq_la-xfce4-cpufreq-plugin.lo `test -f 'xfce4-cpufreq-plugin.c' || echo '$(srcdir)/'`xfce4-cpufreq-plugin.c
libcpufreq_la-xfce4-cpufreq-linux-procfs.lo: xfce4-cpufreq-linux-procfs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -MT libcpufreq_la-xfce4-cpufreq-linux-procfs.lo -MD -MP -MF $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-procfs.Tpo -c -o libcpufreq_la-xfce4-cpufreq-linux-procfs.lo `test -f 'xfce4-cpufreq-linux-procfs.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-procfs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-procfs.Tpo $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-procfs.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfce4-cpufreq-linux-procfs.c' object='libcpufreq_la-xfce4-cpufreq-linux-procfs.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -c -o libcpufreq_la-xfce4-cpufreq-linux-procfs.lo `test -f 'xfce4-cpufreq-linux-procfs.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-procfs.c
libcpufreq_la-xfce4-cpufreq-linux-pstate.lo: xfce4-cpufreq-linux-pstate.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -MT libcpufreq_la-xfce4-cpufreq-linux-pstate.lo -MD -MP -MF $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-pstate.Tpo -c -o libcpufreq_la-xfce4-cpufreq-linux-pstate.lo `test -f 'xfce4-cpufreq-linux-pstate.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-pstate.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-pstate.Tpo $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-pstate.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfce4-cpufreq-linux-pstate.c' object='libcpufreq_la-xfce4-cpufreq-linux-pstate.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -c -o libcpufreq_la-xfce4-cpufreq-linux-pstate.lo `test -f 'xfce4-cpufreq-linux-pstate.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-pstate.c
libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo: xfce4-cpufreq-linux-sysfs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -MT libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo -MD -MP -MF $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-sysfs.Tpo -c -o libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo `test -f 'xfce4-cpufreq-linux-sysfs.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-sysfs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-sysfs.Tpo $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux-sysfs.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfce4-cpufreq-linux-sysfs.c' object='libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -c -o libcpufreq_la-xfce4-cpufreq-linux-sysfs.lo `test -f 'xfce4-cpufreq-linux-sysfs.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux-sysfs.c
libcpufreq_la-xfce4-cpufreq-linux.lo: xfce4-cpufreq-linux.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcpufreq_la_CFLAGS) $(CFLAGS) -MT libcpufreq_la-xfce4-cpufreq-linux.lo -MD -MP -MF $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux.Tpo -c -o libcpufreq_la-xfce4-cpufreq-linux.lo `test -f 'xfce4-cpufreq-linux.c' || echo '$(srcdir)/'`xfce4-cpufreq-linux.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux.Tpo $(DEPDIR)/libcpufreq_la-xfce4-cpufreq-linux.Plo
......
......@@ -18,7 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define BORDER 1
#ifdef HAVE_CONFIG_H
#include <config.h>
......@@ -28,13 +27,7 @@
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-configure.h"
#ifndef _
# include <libintl.h>
# define _(String) gettext (String)
#endif
static void
check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure);
static void
check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
......@@ -59,39 +52,46 @@ check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
cpuFreq->options->one_line =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
if (!cpuFreq->options->show_label_freq &&
!cpuFreq->options->show_label_governor) {
if (!cpuFreq->options->show_label_freq && !cpuFreq->options->show_label_governor)
{
if (!cpuFreq->options->show_icon)
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (configure->display_icon), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (configure->display_icon), TRUE);
gtk_widget_set_sensitive (configure->display_icon, FALSE);
} else
}
else
{
gtk_widget_set_sensitive (configure->display_icon, TRUE);
}
cpufreq_update_icon (cpuFreq);
cpufreq_update_plugin (TRUE);
}
static void
button_fontname_update(GtkWidget *button,
gboolean update_plugin)
button_fontname_update(GtkWidget *button, gboolean update_plugin)
{
if (cpuFreq->options->fontname == NULL)
{
if (cpuFreq->options->fontname == NULL) {
gtk_button_set_label (GTK_BUTTON (button), _("Select font..."));
gtk_widget_set_tooltip_text
(button, _("Select font family and size to use for the labels."));
} else {
gtk_widget_set_tooltip_text (button, _("Select font family and size to use for the labels."));
}
else
{
gtk_button_set_label (GTK_BUTTON (button), cpuFreq->options->fontname);
gtk_widget_set_tooltip_text
(button, _("Right-click to revert to the default font."));
gtk_widget_set_tooltip_text (button, _("Right-click to revert to the default font."));
}
if (update_plugin)
cpufreq_update_plugin (TRUE);
}
static gboolean
button_fontname_clicked(GtkWidget *button,
CpuFreqPluginConfigure *configure)
button_fontname_clicked(GtkWidget *button, CpuFreqPluginConfigure *configure)
{
GtkWidget *fc;
gchar *fontname;
......@@ -104,29 +104,37 @@ button_fontname_clicked(GtkWidget *button,
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (fc), cpuFreq->options->fontname);
result = gtk_dialog_run(GTK_DIALOG(fc));
if (result == GTK_RESPONSE_OK || result == GTK_RESPONSE_ACCEPT) {
if (result == GTK_RESPONSE_OK || result == GTK_RESPONSE_ACCEPT)
{
fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fc));
if (fontname != NULL) {
if (fontname != NULL)
{
gtk_button_set_label(GTK_BUTTON(button), fontname);
g_free (cpuFreq->options->fontname);
cpuFreq->options->fontname = fontname;
}
button_fontname_update(button, TRUE);
}
gtk_widget_destroy(GTK_WIDGET(fc));
return TRUE;
}
static gboolean
button_fontname_pressed(GtkWidget *button,
GdkEventButton *event,
button_fontname_pressed(GtkWidget *button, GdkEventButton *event,
CpuFreqPluginConfigure *configure)
{
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
/* right mouse click clears the font name and resets the button */
if (event->button == 3 && cpuFreq->options->fontname) {
if (event->button == 3 && cpuFreq->options->fontname)
{
g_free (cpuFreq->options->fontname);
cpuFreq->options->fontname = NULL;
button_fontname_update(button, TRUE);
......@@ -137,6 +145,8 @@ button_fontname_pressed(GtkWidget *button,
return FALSE;
}
static void
button_fontcolor_clicked (GtkWidget *button, void *data)
{
......@@ -148,6 +158,8 @@ button_fontcolor_clicked (GtkWidget *button, void *data)
cpufreq_update_plugin (TRUE);
}
static void
combo_changed (GtkWidget *combo, CpuFreqPluginConfigure *configure)
{
......@@ -160,14 +172,17 @@ combo_changed (GtkWidget *combo, CpuFreqPluginConfigure *configure)
}
}
static void
spinner_changed (GtkWidget *spinner, CpuFreqPluginConfigure *configure)
{
cpuFreq->options->timeout =gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinner));
cpufreq_restart_timeout ();
}
static void
cpufreq_configure_response (GtkWidget *dialog, int response, CpuFreqPluginConfigure *configure)
{
......@@ -180,10 +195,11 @@ cpufreq_configure_response (GtkWidget *dialog, int response, CpuFreqPluginConfig
g_free (configure);
}
void
cpufreq_configure (XfcePanelPlugin *plugin)
{
gint i;
gchar *cpu_name;
GtkWidget *dialog, *dialog_vbox;
GtkWidget *frame, *align, *label, *vbox, *hbox;
......@@ -198,9 +214,8 @@ cpufreq_configure (XfcePanelPlugin *plugin)
dialog = xfce_titled_dialog_new_with_buttons (_("Configure CPU Frequency Monitor"),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-close", GTK_RESPONSE_OK,
NULL);
GTK_DIALOG_DESTROY_WITH_PARENT, "gtk-close", GTK_RESPONSE_OK, NULL);
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), _("Configure the CPU frequency plugin"));
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
......@@ -211,6 +226,8 @@ cpufreq_configure (XfcePanelPlugin *plugin)
g_object_set_data (G_OBJECT (cpuFreq->plugin), "configure", dialog);
dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 12);
gtk_box_set_spacing (GTK_BOX (dialog_vbox), 18);
sg0 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
......@@ -223,24 +240,18 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
align = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
align = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_halign(align, GTK_ALIGN_START);
gtk_widget_set_valign(align, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand(align, TRUE);
gtk_widget_set_vexpand(align, TRUE);
gtk_container_add (GTK_CONTAINER (frame), align);
gtk_widget_set_margin_top (align, 0);
gtk_widget_set_margin_bottom (align, 0);
gtk_widget_set_margin_start (align, BORDER * 3);
gtk_widget_set_margin_end (align, 0);
gtk_widget_set_margin_top (align, 6);
gtk_widget_set_margin_start (align, 12);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, BORDER);
gtk_container_add (GTK_CONTAINER (align), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_add (GTK_CONTAINER (align), hbox);
label = gtk_label_new_with_mnemonic (_("_Update interval:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
......@@ -252,8 +263,8 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinner);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinner), (gdouble) cpuFreq->options->timeout);
gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (spinner), "value-changed", G_CALLBACK (spinner_changed), configure);
g_signal_connect (G_OBJECT (spinner), "value-changed",
G_CALLBACK (spinner_changed), configure);
/* panel behaviours */
frame = gtk_frame_new (NULL);
......@@ -264,24 +275,21 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
align = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
align = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_halign(align, GTK_ALIGN_FILL);
gtk_widget_set_valign(align, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand(align, TRUE);
gtk_widget_set_vexpand(align, TRUE);
gtk_container_add (GTK_CONTAINER (frame), align);
gtk_widget_set_margin_top (align, 0);
gtk_widget_set_margin_bottom (align, 0);
gtk_widget_set_margin_start (align, BORDER * 3);
gtk_widget_set_margin_end (align, 0);
gtk_widget_set_margin_top (align, 6);
gtk_widget_set_margin_start (align, 12);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, BORDER);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (align), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
/* font settings */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Font:"));
......@@ -300,7 +308,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
button_fontname_update (button, FALSE);
/* font color */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Font color:"));
......@@ -320,7 +328,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
g_free (color);
/* which cpu to show in panel */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Display CPU:"));
......@@ -333,12 +341,13 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
for (i = 0; i < cpuFreq->cpus->len; ++i)
for (guint i = 0; i < cpuFreq->cpus->len; ++i)
{
cpu_name = g_strdup_printf ("%d", i);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), cpu_name);
g_free (cpu_name);
}
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("min"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("avg"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("max"));
......
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-linux-procfs.h"
#define PROCFS_BASE "/proc/cpufreq"
gboolean
cpufreq_procfs_is_available (void)
{
return g_file_test (PROCFS_BASE, G_FILE_TEST_EXISTS);
}
gboolean
cpufreq_procfs_read_cpuinfo (void)
{
CpuInfo *cpu;
FILE *file;
gchar *freq, *filePath, *fileContent;
guint i = 0;
gboolean add_cpu;
filePath = g_strdup ("/proc/cpuinfo");
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
{
g_free (filePath);
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fileContent = g_new (gchar,255);
while (fgets (fileContent, 255, file) != NULL)
{
if (g_ascii_strncasecmp (fileContent, "cpu MHz", 7) == 0)
{
cpu = NULL;
add_cpu = FALSE;
if (cpuFreq->cpus && cpuFreq->cpus->len > i)
cpu = g_ptr_array_index (cpuFreq->cpus, i);
if (cpu == NULL)
{
cpu = g_new0 (CpuInfo, 1);
cpu->max_freq = 0;
cpu->min_freq = 0;
cpu->cur_governor = NULL;
cpu->available_freqs = NULL;
cpu->available_governors = NULL;
cpu->online = TRUE;
add_cpu = TRUE;
}
freq = g_strrstr (fileContent, ":");
if (freq == NULL)
{
if (add_cpu)
cpuinfo_free (cpu);
break;
}
sscanf (++freq, "%d.", &cpu->cur_freq);
cpu->cur_freq *= 1000;
if (add_cpu && cpu != NULL)
g_ptr_array_add (cpuFreq->cpus, cpu);
++i;
}
}
fclose (file);
g_free (fileContent);
}
g_free (filePath);
return TRUE;
}
gboolean
cpufreq_procfs_read (void)
{
CpuInfo *cpu;
FILE *file;
gchar *filePath, *fileContent;
filePath = g_strdup (PROCFS_BASE);
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
{
g_free (filePath);
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fileContent = g_new (gchar, 255);
while (fgets (fileContent, 255, file) != NULL)
{
if (g_ascii_strncasecmp (fileContent, "CPU", 3) == 0)
{
cpu = g_new0 (CpuInfo, 1);
cpu->max_freq = 0;
cpu->min_freq = 0;
cpu->cur_governor = g_new (gchar, 20);
cpu->available_freqs = NULL;
cpu->available_governors = NULL;
cpu->online = TRUE;
sscanf (fileContent,
"CPU %*d %d kHz (%*d %%) - %d kHz (%*d %%) - %20s",
&cpu->min_freq,
&cpu->max_freq,
cpu->cur_governor);
cpu->min_freq *= 1000;
cpu->max_freq *= 1000;
g_ptr_array_add (cpuFreq->cpus, cpu);
}
}
fclose (file);
g_free (fileContent);
}
g_free (filePath);
for (guint i = 0; i < cpuFreq->cpus->len; i++)
{
cpu = g_ptr_array_index (cpuFreq->cpus, i);
filePath = g_strdup_printf ("/proc/sys/cpu/%d/speed", i);
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
{
g_free (filePath);
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fscanf (file, "%d", &cpu->cur_freq);
fclose (file);
}
g_free (filePath);
}
return TRUE;
}
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef XFCE4_CPUFREQ_LINUX_PROCFS_H
#define XFCE4_CPUFREQ_LINUX_PROCFS_H
G_BEGIN_DECLS
gboolean cpufreq_procfs_is_available (void);
gboolean cpufreq_procfs_read (void);
gboolean cpufreq_procfs_read_cpuinfo (void);
G_END_DECLS
#endif /* XFCE4_CPUFREQ_LINUX_PROCFS_H */
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-linux-pstate.h"
#include "xfce4-cpufreq-linux-sysfs.h"
#define PSTATE_BASE "/sys/devices/system/cpu/intel_pstate"
static gboolean read_params ();
gboolean
cpufreq_pstate_is_available (void)
{
return g_file_test (PSTATE_BASE, G_FILE_TEST_EXISTS);
}
gboolean
cpufreq_pstate_read (void)
{
/* gather intel pstate parameters */
if (!read_params ())
return FALSE;
/* now read the number of cpus and the remaining cpufreq info
for each of them from sysfs */
if (!cpufreq_sysfs_read ())
return FALSE;
return TRUE;
}
static gboolean
read_params (void)
{
gchar *file;
IntelPState *ips;
ips = g_slice_new0(IntelPState);
if (!g_file_test (PSTATE_BASE, G_FILE_TEST_EXISTS))
return FALSE;
file = g_strdup (PSTATE_BASE "/min_perf_pct");
cpufreq_sysfs_read_int (file, &ips->min_perf_pct);
g_free (file);
file = g_strdup (PSTATE_BASE "/max_perf_pct");
cpufreq_sysfs_read_int (file, &ips->max_perf_pct);
g_free (file);
file = g_strdup (PSTATE_BASE "/no_turbo");
cpufreq_sysfs_read_int (file, &ips->no_turbo);
g_free (file);
g_slice_free (IntelPState, cpuFreq->intel_pstate);
cpuFreq->intel_pstate = ips;
return TRUE;
}
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef XFCE4_CPUFREQ_LINUX_PSTATE_H
#define XFCE4_CPUFREQ_LINUX_PSTATE_H
G_BEGIN_DECLS
gboolean cpufreq_pstate_is_available (void);
gboolean cpufreq_pstate_read (void);
G_END_DECLS
#endif /* XFCE4_CPUFREQ_LINUX_PSTATE_H */
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-linux-sysfs.h"
#define SYSFS_BASE "/sys/devices/system/cpu"
static void cpufreq_sysfs_read_int_list (gchar *file, GList **list);
static void cpufreq_sysfs_read_string (gchar *file, gchar **string);
static void cpufreq_sysfs_read_string_list (gchar *file, GList **list);
static void parse_sysfs_init (gint cpu_number, CpuInfo *cpu);
static inline gchar* read_file_contents (const gchar *file);
static inline gboolean cpufreq_cpu_exists (gint num);
gboolean
cpufreq_sysfs_is_available (void)
{
return g_file_test (SYSFS_BASE"/cpu0/cpufreq", G_FILE_TEST_EXISTS);
}
void
cpufreq_sysfs_read_current (gint cpu_number)
{
CpuInfo *cpu;
gchar *file;
cpu = g_ptr_array_index (cpuFreq->cpus, cpu_number);
/* read current cpu freq */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_cur_freq", cpu_number);
cpufreq_sysfs_read_int (file, &cpu->cur_freq);
g_free (file);
/* read current cpu governor */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_governor", cpu_number);
cpufreq_sysfs_read_string (file, &cpu->cur_governor);
g_free (file);
/* read whether the cpu is online, skip first */
if (cpu_number != 0)
{
guint online;
file = g_strdup_printf (SYSFS_BASE"/cpu%i/online", cpu_number);
cpufreq_sysfs_read_int (file, &online);
g_free (file);
cpu->online = online != 0;
}
}
gboolean
cpufreq_sysfs_read (void)
{
gint count = 0, i = 0;
while (cpufreq_cpu_exists (count))
count++;
if (count == 0)
return FALSE;
while (i < count)
parse_sysfs_init (i++, NULL);
return TRUE;
}
void
cpufreq_sysfs_read_int (gchar *file, guint *intval)
{
gchar *contents = read_file_contents (file);
if (contents) {
(*intval) = atoi (contents);
g_free (contents);
}
}
static void
cpufreq_sysfs_read_int_list (gchar *file, GList **list)
{
gchar *contents = read_file_contents (file);
if (contents) {
gchar **tokens = NULL;
gint i = 0;
tokens = g_strsplit (contents, " ", 0);
g_free (contents);
g_list_free (*list);
while (tokens[i] != NULL) {
gint value = atoi (tokens[i]);
*list = g_list_append (*list, GINT_TO_POINTER (value));
i++;
}
g_strfreev (tokens);
}
}
static void
cpufreq_sysfs_read_string (gchar *file, gchar **string)
{
gchar *contents = read_file_contents (file);
if (contents) {
g_free (*string);
*string = contents;
}
}
static void
cpufreq_sysfs_read_string_list (gchar *file, GList **list)
{
gchar *contents = read_file_contents (file);
if (contents) {
gchar **tokens = NULL;
gint i = 0;
tokens = g_strsplit (contents, " ", 0);
g_free (contents);
g_list_free_full (*list, g_free);
while (tokens[i] != NULL) {
*list = g_list_append (*list, strdup (tokens[i]));
i++;
}
g_strfreev (tokens);
}
}
static void
parse_sysfs_init (gint cpu_number, CpuInfo *cpu)
{
gchar *file;
gboolean add_cpu = FALSE;
if (cpu == NULL) {
cpu = g_new0 (CpuInfo, 1);
cpu->online = TRUE;
add_cpu = TRUE;
}
/* read available cpu freqs */
if (cpuFreq->intel_pstate == NULL) {
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_available_frequencies", cpu_number);
cpufreq_sysfs_read_int_list (file, &cpu->available_freqs);
g_free (file);
}
/* read available cpu governors */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_available_governors", cpu_number);
cpufreq_sysfs_read_string_list (file, &cpu->available_governors);
g_free (file);
/* read cpu driver */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_driver", cpu_number);
cpufreq_sysfs_read_string (file, &cpu->scaling_driver);
g_free (file);
/* read current cpu freq */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_cur_freq", cpu_number);
cpufreq_sysfs_read_int (file, &cpu->cur_freq);
g_free (file);
/* read current cpu governor */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_governor", cpu_number);
cpufreq_sysfs_read_string (file, &cpu->cur_governor);
g_free (file);
/* read max cpu freq */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_max_freq", cpu_number);
cpufreq_sysfs_read_int (file, &cpu->max_freq);
g_free (file);
/* read min cpu freq */
file = g_strdup_printf (SYSFS_BASE"/cpu%i/cpufreq/scaling_min_freq", cpu_number);
cpufreq_sysfs_read_int (file, &cpu->min_freq);
g_free (file);
if (add_cpu)
g_ptr_array_add (cpuFreq->cpus, cpu);
}
static inline gchar*
read_file_contents (const gchar *file)
{
GError *error = NULL;
gchar *contents = NULL;
if (!g_file_test (file, G_FILE_TEST_EXISTS))
return NULL;
if (g_file_get_contents (file, &contents, NULL, &error)) {
g_strstrip (contents);
return contents;
}
g_debug ("Error reading %s: %s\n", file, error->message);
g_error_free (error);
return NULL;
}
static inline gboolean
cpufreq_cpu_exists (gint num)
{
gchar *file;
gboolean ret;
file = g_strdup_printf ("%s/cpu%d", SYSFS_BASE, num);
ret = g_file_test (file, G_FILE_TEST_EXISTS);
g_free (file);
return ret;
}
/* xfce4-cpu-freq-plugin - panel plugin for cpu informations
*
* Copyright (c) 2018 Andre Miranda <andreldm@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef XFCE4_CPUFREQ_LINUX_SYSFS_H
#define XFCE4_CPUFREQ_LINUX_SYSFS_H
G_BEGIN_DECLS
gboolean cpufreq_sysfs_is_available (void);
gboolean cpufreq_sysfs_read (void);
void cpufreq_sysfs_read_current (gint cpu_number);
void cpufreq_sysfs_read_int (gchar *file, guint *intval);
G_END_DECLS
#endif /* XFCE4_CPUFREQ_LINUX_SYSFS_H */
......@@ -25,402 +25,78 @@
#include <stdlib.h>
#include <dirent.h>
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-linux.h"
#include <libxfce4ui/libxfce4ui.h>
#ifndef _
# include <libintl.h>
# define _(String) gettext (String)
#endif
#define SYSFS_READ_STRING(file, contents, string) \
if (contents = read_sysfs_file_contents (file)) { \
g_free (string); \
string = contents; \
}
#define SYSFS_READ_STRING_LIST(file, contents, list) \
if (contents = read_sysfs_file_contents (file)) { \
gchar **tokens = NULL; \
gint i = 0; \
tokens = g_strsplit (contents, " ", 0); \
g_free (contents); \
g_list_free_full (list, g_free); \
while (tokens[i] != NULL) { \
list = g_list_append (list, strdup (tokens[i])); \
i++; \
} \
g_strfreev (tokens); \
}
#define SYSFS_READ_INT(file, contents, intval) \
if (contents = read_sysfs_file_contents (file)) { \
intval = atoi (contents); \
g_free (contents); \
}
#define SYSFS_READ_INT_LIST(file, contents, list) \
if (contents = read_sysfs_file_contents (file)) { \
gchar **tokens = NULL; \
gint i = 0; \
tokens = g_strsplit (contents, " ", 0); \
g_free (contents); \
g_list_free (list); \
while (tokens[i] != NULL) { \
gint value = atoi (tokens[i]); \
list = g_list_append (list, GINT_TO_POINTER (value)); \
i++; \
} \
g_strfreev (tokens); \
}
static inline gchar *
read_sysfs_file_contents (const gchar *file)
{
GError *error = NULL;
gchar *contents = NULL;
if (!g_file_test (file, G_FILE_TEST_EXISTS))
return NULL;
if (g_file_get_contents (file, &contents, NULL, &error)) {
g_strstrip (contents);
return contents;
} else {
g_debug ("Error reading %s: %s\n", file, error->message);
g_error_free (error);
return NULL;
}
}
static void
cpufreq_cpu_parse_sysfs_init (gint cpu_number, CpuInfo *cpu)
{
gchar *file, *contents;
gboolean add_cpu = FALSE;
if (cpu == NULL) {
cpu = g_new0 (CpuInfo, 1);
add_cpu = TRUE;
}
/* read available cpu freqs */
if (cpuFreq->intel_pstate == NULL) {
file =
g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
"cpufreq/scaling_available_frequencies",
cpu_number);
SYSFS_READ_INT_LIST (file, contents, cpu->available_freqs);
g_free (file);
}
/* read available cpu governors */
file = g_strdup_printf (
"/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_governors",
cpu_number);
SYSFS_READ_STRING_LIST (file, contents, cpu->available_governors);
g_free (file);
/* read cpu driver */
file = g_strdup_printf (
"/sys/devices/system/cpu/cpu%i/cpufreq/scaling_driver",
cpu_number);
SYSFS_READ_STRING (file, contents, cpu->scaling_driver);
g_free (file);
/* read current cpu freq */
file = g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
"cpufreq/scaling_cur_freq",
cpu_number);
SYSFS_READ_INT (file, contents, cpu->cur_freq);
g_free (file);
/* read current cpu governor */
file = g_strdup_printf (
"/sys/devices/system/cpu/cpu%i/cpufreq/scaling_governor",
cpu_number);
SYSFS_READ_STRING (file, contents, cpu->cur_governor);
g_free (file);
/* read max cpu freq */
file = g_strdup_printf (
"/sys/devices/system/cpu/cpu%i/cpufreq/scaling_max_freq",
cpu_number);
SYSFS_READ_INT (file, contents, cpu->max_freq);
g_free (file);
/* read min cpu freq */
file = g_strdup_printf (
"/sys/devices/system/cpu/cpu%i/cpufreq/scaling_min_freq",
cpu_number);
SYSFS_READ_INT (file, contents, cpu->min_freq);
g_free (file);
if (add_cpu)
g_ptr_array_add (cpuFreq->cpus, cpu);
}
static void
cpufreq_cpu_read_sysfs_current (gint cpu_number)
{
CpuInfo *cpu;
gchar *file, *contents;
cpu = g_ptr_array_index (cpuFreq->cpus, cpu_number);
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-linux.h"
#include "xfce4-cpufreq-linux-procfs.h"
#include "xfce4-cpufreq-linux-pstate.h"
#include "xfce4-cpufreq-linux-sysfs.h"
/* read current cpu freq */
file = g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
"cpufreq/scaling_cur_freq",
cpu_number);
SYSFS_READ_INT (file, contents, cpu->cur_freq);
g_free (file);
/* read current cpu governor */
file = g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
"cpufreq/scaling_governor",
cpu_number);
SYSFS_READ_STRING (file, contents, cpu->cur_governor);
g_free (file);
}
static gboolean
cpufreq_cpu_read_procfs_cpuinfo ()
{
CpuInfo *cpu;
FILE *file;
gchar *freq, *filePath, *fileContent;
gint i = 0;
gboolean add_cpu;
filePath = g_strdup ("/proc/cpuinfo");
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
gboolean
cpufreq_linux_init (void)
{
g_free (filePath);
if (cpuFreq->cpus == NULL)
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fileContent = g_new (gchar,255);
while (fgets (fileContent, 255, file) != NULL)
{
if (g_ascii_strncasecmp (fileContent, "cpu MHz", 7) == 0)
{
cpu = NULL;
add_cpu = FALSE;
if (cpuFreq->cpus && cpuFreq->cpus->len > i)
{
cpu = g_ptr_array_index (cpuFreq->cpus, i);
}
if (cpufreq_sysfs_is_available ())
return cpufreq_sysfs_read ();
if (cpu == NULL)
if (cpufreq_pstate_is_available ())
{
cpu = g_new0 (CpuInfo, 1);
cpu->max_freq = 0;
cpu->min_freq = 0;
cpu->cur_governor = NULL;
cpu->available_freqs = NULL;
cpu->available_governors = NULL;
add_cpu = TRUE;
}
freq = g_strrstr (fileContent, ":");
if (freq != NULL)
{
sscanf (++freq, "%d.", &cpu->cur_freq);
cpu->cur_freq *= 1000;
}
else {
if (add_cpu)
cpuinfo_free (cpu);
break;
}
if (add_cpu && cpu != NULL)
g_ptr_array_add (cpuFreq->cpus, cpu);
++i;
}
}
fclose (file);
g_free (fileContent);
}
g_free (filePath);
return TRUE;
}
static gboolean
cpufreq_cpu_read_procfs ()
{
CpuInfo *cpu;
FILE *file;
gint i;
gchar *filePath, *fileContent;
filePath = g_strdup ("/proc/cpufreq");
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
{
g_free (filePath);
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fileContent = g_new (gchar, 255);
while (fgets (fileContent, 255, file) != NULL)
{
if (g_ascii_strncasecmp (fileContent, "CPU", 3) == 0)
{
cpu = g_new0 (CpuInfo, 1);
cpu->max_freq = 0;
cpu->min_freq = 0;
cpu->cur_governor = g_new (gchar, 20);
cpu->available_freqs = NULL;
cpu->available_governors = NULL;
sscanf (fileContent,
"CPU %*d %d kHz (%*d %%) - %d kHz (%*d %%) - %20s",
&cpu->min_freq,
&cpu->max_freq,
cpu->cur_governor);
cpu->min_freq *= 1000;
cpu->max_freq *= 1000;
g_ptr_array_add (cpuFreq->cpus, cpu);
}
}
fclose (file);
g_free (fileContent);
}
g_free (filePath);
gboolean ret = cpufreq_pstate_read ();
for (i = 0; i < cpuFreq->cpus->len; i++)
{
cpu = g_ptr_array_index (cpuFreq->cpus, i);
filePath = g_strdup_printf ("/proc/sys/cpu/%d/speed", i);
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
{
g_free (filePath);
return FALSE;
}
file = fopen (filePath, "r");
if (file)
{
fscanf (file, "%d", &cpu->cur_freq);
fclose (file);
}
g_free (filePath);
}
return TRUE;
/* Tools like i7z show the current real frequency using the
current maximum performance. Assuming this is the proper
way to do it, let's choose the maximum per default. Most
CPUs nowadays have more than one core anyway, so there will
not be much use in showing a single core's performance
value. Besides, it's not very likely the user wants to
follow values for 4 or 8 cores per second. */
if (ret && cpuFreq->options->show_warning) {
cpuFreq->options->show_cpu = CPU_MAX;
cpuFreq->options->show_warning = FALSE;
}
static inline gboolean
cpufreq_cpu_exists (gint num)
{
const gchar *base = "/sys/devices/system/cpu";
gchar *file;
gboolean ret;
file = g_strdup_printf ("%s/cpu%d", base, num);
ret = g_file_test (file, G_FILE_TEST_EXISTS);
g_free (file);
return ret;
}
static gboolean
cpufreq_cpu_read_sysfs (void)
{
gchar *file;
gint count = 0, i = 0;
while (cpufreq_cpu_exists (count))
count++;
if (count == 0)
return FALSE;
while (i < count)
cpufreq_cpu_parse_sysfs_init (i++, NULL);
return TRUE;
}
if (cpufreq_procfs_is_available ())
return cpufreq_procfs_read ();
gboolean
cpufreq_intel_pstate_params (void)
if (cpuFreq->options->show_warning)
{
gchar *file, *contents;
IntelPState *ips;
ips = g_slice_new0(IntelPState);
if (!g_file_test ("/sys/devices/system/cpu/intel_pstate",
G_FILE_TEST_EXISTS))
return FALSE;
file =
g_strdup ("/sys/devices/system/cpu/intel_pstate/min_perf_pct");
SYSFS_READ_INT (file, contents, ips->min_perf_pct);
g_free (file);
file =
g_strdup ("/sys/devices/system/cpu/intel_pstate/max_perf_pct");
SYSFS_READ_INT (file, contents, ips->max_perf_pct);
g_free (file);
file =
g_strdup ("/sys/devices/system/cpu/intel_pstate/no_turbo");
SYSFS_READ_INT (file, contents, ips->no_turbo);
g_free (file);
xfce_dialog_show_warning (NULL, NULL,
_("Your system does not support cpufreq.\nThe applet only shows the current cpu frequency"));
cpuFreq->options->show_warning = FALSE;
}
g_slice_free (IntelPState, cpuFreq->intel_pstate);
cpuFreq->intel_pstate = ips;
return TRUE;
return cpufreq_procfs_read_cpuinfo ();
}
static gboolean
cpufreq_cpu_intel_pstate_read ()
{
CpuInfo *cpu;
gint i;
/* gather intel pstate parameters */
if (!cpufreq_intel_pstate_params ())
return FALSE;
/* now read the number of cpus and the remaining cpufreq info
for each of them from sysfs */
if (!cpufreq_cpu_read_sysfs ())
{
return FALSE;
}
return TRUE;
}
gboolean
cpufreq_update_cpus (gpointer data)
{
gint i;
if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq",
G_FILE_TEST_EXISTS))
if (cpufreq_sysfs_is_available ())
{
for (i = 0; i < cpuFreq->cpus->len; i++)
cpufreq_cpu_read_sysfs_current (i);
for (guint i = 0; i < cpuFreq->cpus->len; i++)
cpufreq_sysfs_read_current (i);
}
else if (g_file_test ("/proc/cpufreq", G_FILE_TEST_EXISTS))
else if (cpufreq_procfs_is_available ())
{
/* First we delete the cpus and then read the /proc/cpufreq file again */
for (i = 0; i < cpuFreq->cpus->len; i++)
for (guint i = 0; i < cpuFreq->cpus->len; i++)
{
CpuInfo *cpu = g_ptr_array_index (cpuFreq->cpus, i);
g_ptr_array_remove_fast (cpuFreq->cpus, cpu);
cpuinfo_free (cpu);
}
cpufreq_cpu_read_procfs ();
cpufreq_procfs_read ();
}
else
{
......@@ -430,42 +106,3 @@ cpufreq_update_cpus (gpointer data)
return cpufreq_update_plugin (FALSE);
}
gboolean
cpufreq_linux_init (void)
{
if (cpuFreq->cpus == NULL)
return FALSE;
if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS))
return cpufreq_cpu_read_sysfs ();
else if (g_file_test ("/sys/devices/system/cpu/intel_pstate", G_FILE_TEST_EXISTS))
{
gboolean ret = cpufreq_cpu_intel_pstate_read ();
/* Tools like i7z show the current real frequency using the
current maximum performance. Assuming this is the proper
way to do it, let's choose the maximum per default. Most
CPUs nowadays have more than one core anyway, so there will
not be much use in showing a single core's performance
value. Besides, it's not very likely the user wants to
follow values for 4 or 8 cores per second. */
if (ret && cpuFreq->options->show_warning) {
cpuFreq->options->show_cpu = CPU_MAX;
cpuFreq->options->show_warning = FALSE;
}
return ret;
}
else if (g_file_test ("/proc/cpufreq", G_FILE_TEST_EXISTS))
return cpufreq_cpu_read_procfs ();
else
{
if (cpuFreq->options->show_warning)
{
xfce_dialog_show_warning (NULL, NULL, _("Your system does not support cpufreq.\nThe applet only shows the current cpu frequency"));
cpuFreq->options->show_warning = FALSE;
}
return cpufreq_cpu_read_procfs_cpuinfo ();
}
}
......@@ -26,9 +26,6 @@ G_BEGIN_DECLS
gboolean
cpufreq_update_cpus (gpointer data);
gboolean
cpufreq_intel_pstate_params (void);
gboolean
cpufreq_linux_init (void);
......
......@@ -25,17 +25,16 @@
#endif
#include <libxfce4ui/libxfce4ui.h>
#ifndef _
# include <libintl.h>
# define _(String) gettext (String)
#endif
#include "xfce4-cpufreq-plugin.h"
#include "xfce4-cpufreq-overview.h"
#include "xfce4-cpufreq-utils.h"
#ifdef __linux__
#include "xfce4-cpufreq-linux.h"
#endif /* __linux__ */
#include "xfce4-cpufreq-overview.h"
#include "xfce4-cpufreq-utils.h"
static void
cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
......@@ -47,6 +46,7 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
GList *list;
dialog_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, BORDER);
gtk_widget_set_sensitive (dialog_vbox, cpu->online);
gtk_box_pack_start (GTK_BOX (dialog_hbox), dialog_vbox, TRUE, TRUE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER);
......@@ -114,9 +114,11 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
j = 0;
while (list)
{
text = cpufreq_get_human_readable_freq (GPOINTER_TO_INT (list->data));
if (GPOINTER_TO_INT (list->data) == cpu->cur_freq)
text = cpufreq_get_human_readable_freq (GPOINTER_TO_UINT (list->data));
if (GPOINTER_TO_UINT (list->data) == cpu->cur_freq)
i = j;
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), text);
g_free (text);
list = g_list_next (list);
......@@ -133,9 +135,11 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
text = cpufreq_get_human_readable_freq (cpu->cur_freq);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), text);
g_free (text);
text = cpufreq_get_human_readable_freq (cpu->max_freq);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), text);
g_free (text);
text = cpufreq_get_human_readable_freq (cpu->min_freq);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), text);
g_free (text);
......@@ -173,11 +177,14 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
gtk_box_pack_end (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
list = g_list_first (cpu->available_governors);
j = 0;
while (list)
{
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), list->data);
if (g_ascii_strcasecmp (list->data, cpu->cur_governor) == 0)
i = j;
list = g_list_next (list);
j++;
}
......@@ -211,6 +218,8 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, GtkWidget *dialog_hbox)
g_object_unref (sg1);
}
static void
cpufreq_overview_response (GtkWidget *dialog, gint response, gpointer data)
{
......@@ -219,78 +228,74 @@ cpufreq_overview_response (GtkWidget *dialog, gint response, gpointer data)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpuFreq->button), FALSE);
}
gboolean
cpufreq_overview (GtkWidget *widget, GdkEventButton *ev, CpuFreqPlugin *cpuFreq)
cpufreq_overview (GtkWidget *widget, GdkEventButton *ev, CpuFreqPlugin *cpufreq)
{
gint i, j, step;
gint step;
GtkWidget *dialog, *dialog_vbox, *window;
GtkWidget *dialog_hbox, *separator;
if (ev->button != 1)
return FALSE;
window = g_object_get_data (G_OBJECT (cpuFreq->plugin), "overview");
window = g_object_get_data (G_OBJECT (cpufreq->plugin), "overview");
if (window) {
g_object_set_data (G_OBJECT (cpuFreq->plugin), "overview", NULL);
g_object_set_data (G_OBJECT (cpufreq->plugin), "overview", NULL);
gtk_widget_destroy (window);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpuFreq->button),
FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpufreq->button), FALSE);
return TRUE;
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpuFreq->button),
TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpufreq->button), TRUE);
dialog = xfce_titled_dialog_new_with_buttons (_("CPU Information"),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (cpuFreq->plugin))),
GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-close", GTK_RESPONSE_OK,
NULL);
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (cpufreq->plugin))),
GTK_DIALOG_DESTROY_WITH_PARENT, "gtk-close", GTK_RESPONSE_OK, NULL);
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog),
_("An overview of all the CPUs in the system"));
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "xfce4-cpufreq-plugin");
g_object_set_data (G_OBJECT (cpuFreq->plugin), "overview", dialog);
g_object_set_data (G_OBJECT (cpufreq->plugin), "overview", dialog);
dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
/* choose how many columns and rows depending on cpu count */
if (cpuFreq->cpus->len < 4)
if (cpufreq->cpus->len < 4)
step = 1;
else if (cpuFreq->cpus->len < 9)
else if (cpufreq->cpus->len < 9)
step = 2;
else if (cpuFreq->cpus->len % 3)
else if (cpufreq->cpus->len % 3)
step = 4;
else
step = 3;
for (i = 0; i < cpuFreq->cpus->len; i += step) {
for (guint i = 0; i < cpufreq->cpus->len; i += step) {
dialog_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, BORDER * 2);
gtk_box_pack_start (GTK_BOX (dialog_vbox), dialog_hbox,
FALSE, FALSE, BORDER * 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog_hbox),
BORDER * 2);
gtk_box_pack_start (GTK_BOX (dialog_vbox), dialog_hbox, FALSE, FALSE, BORDER * 2);
gtk_container_set_border_width (GTK_CONTAINER (dialog_hbox), BORDER * 2);
for (j = i; j < cpuFreq->cpus->len && j < i + step; j++) {
CpuInfo *cpu = g_ptr_array_index (cpuFreq->cpus, j);
for (guint j = i; j < cpufreq->cpus->len && j < i + step; j++) {
CpuInfo *cpu = g_ptr_array_index (cpufreq->cpus, j);
cpufreq_overview_add (cpu, j, dialog_hbox);
if (j + 1 < cpuFreq->cpus->len && j + 1 == i + step) {
if (j + 1 < cpufreq->cpus->len && j + 1 == i + step) {
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (dialog_vbox), separator,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (dialog_vbox), separator, FALSE, FALSE, 0);
}
if (j + 1 < cpuFreq->cpus->len && j + 1 < i + step) {
if (j + 1 < cpufreq->cpus->len && j + 1 < i + step) {
separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (GTK_BOX (dialog_hbox), separator,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (dialog_hbox), separator, FALSE, FALSE, 0);
}
}
}
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (cpufreq_overview_response), NULL);
......