pax_global_header00006660000000000000000000000064121107274700014513gustar00rootroot0000000000000052 comment=df3a426ef01113b54249c2cb217603b3ecbff5d2 eclipse-cdt-pkg-config-1.0.0~git20130115/000077500000000000000000000000001211072747000174465ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/000077500000000000000000000000001211072747000273415ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/.classpath000066400000000000000000000005611211072747000313260ustar00rootroot00000000000000 eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/.project000066400000000000000000000016521211072747000310140ustar00rootroot00000000000000 org.eclipse.cdt.managedbuilder.pkgconfig com.trolltech.qtjambi.juicBuilder org.eclipse.jdt.core.javabuilder org.eclipse.pde.ManifestBuilder org.eclipse.pde.SchemaBuilder org.topcased.modeler.org.topcased.modeler.builders.todoNoteBuilder org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/.settings/000077500000000000000000000000001211072747000312575ustar00rootroot00000000000000org.eclipse.jdt.core.prefs000066400000000000000000000124571211072747000361730ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/.settings#Tue Sep 06 20:34:41 EEST 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=error org.eclipse.jdt.core.compiler.problem.comparingIdentical=error org.eclipse.jdt.core.compiler.problem.deadCode=error org.eclipse.jdt.core.compiler.problem.deprecation=error org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=error org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fieldHiding=error org.eclipse.jdt.core.compiler.problem.finalParameterBound=error org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error org.eclipse.jdt.core.compiler.problem.localVariableHiding=error org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error org.eclipse.jdt.core.compiler.problem.nullReference=error org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error org.eclipse.jdt.core.compiler.problem.parameterAssignment=error org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error org.eclipse.jdt.core.compiler.problem.potentialNullReference=error org.eclipse.jdt.core.compiler.problem.rawTypeReference=error org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=error org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=error org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error org.eclipse.jdt.core.compiler.problem.unnecessaryElse=error org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=error org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled org.eclipse.jdt.core.compiler.problem.unusedImport=error org.eclipse.jdt.core.compiler.problem.unusedLabel=error org.eclipse.jdt.core.compiler.problem.unusedLocal=error org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error org.eclipse.jdt.core.compiler.problem.unusedParameter=warning org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error org.eclipse.jdt.core.compiler.source=1.6 eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/META-INF/000077500000000000000000000000001211072747000305015ustar00rootroot00000000000000MANIFEST.MF000066400000000000000000000021111211072747000320470ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/META-INFManifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Petri Tuononen Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.pkgconfig;singleton:=true Bundle-Version: 0.8.0.qualifier Bundle-Activator: org.eclipse.cdt.managedbuilder.pkgconfig.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.resources, org.eclipse.cdt.core;bundle-version="5.3.0", org.eclipse.cdt.ui;bundle-version="5.3.0" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: org.eclipse.cdt.managedbuilder.pkgconfig; uses:="org.eclipse.core.runtime, org.eclipse.jface.resource, org.eclipse.ui.plugin, org.osgi.framework", org.eclipse.cdt.managedbuilder.pkgconfig.preferences; uses:="org.eclipse.osgi.util, org.eclipse.jface.preference, org.eclipse.ui, org.eclipse.core.runtime.preferences, org.eclipse.swt.widgets", org.eclipse.cdt.managedbuilder.pkgconfig.properties, org.eclipse.cdt.managedbuilder.pkgconfig.util Import-Package: org.eclipse.cdt.managedbuilder.core, org.eclipse.ui Bundle-Vendor: Pkg-config support eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/OSGI-INF/000077500000000000000000000000001211072747000305145ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/OSGI-INF/l10n/000077500000000000000000000000001211072747000312665ustar00rootroot00000000000000bundle.properties000066400000000000000000000001241211072747000345730ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/OSGI-INF/l10n#Properties file for org.eclipse.cdt.managedbuilder.pkgconfig page.name = Pkg-configeclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML/000077500000000000000000000000001211072747000277765ustar00rootroot00000000000000class_diagram.grn000066400000000000000000000153601211072747000332250ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML external_setting_provider.grn000066400000000000000000000004741211072747000357250ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML/parser.grn000066400000000000000000000004041211072747000320000ustar00rootroot00000000000000 pkg-config_util.grn000066400000000000000000000004221211072747000335060ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML preference_page.grn000066400000000000000000000044171211072747000335470ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML property_page.grn000066400000000000000000000046521211072747000333160ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/UML VersionChangeLog.txt000066400000000000000000000011201211072747000332120ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig1.0.0 * Made pkg-config another "tool" of a toolchain, so that Eclipse plugins registering toolchains can specify the path to a toolchain-specific pkg-config binary along with the path to other traditional tools (compilers, etc). * Tycho support to automate the build and the update-site creation. 0.8.0 * Project-level configuration * Use of environment variable on the pkg-config command * Preference to set pkg-config binary path * Use of List instead of ArrayList 0.5.4 * Allow spaces in pkg-config path under Unix systems * NullPointerError fixed on pkg-config property tabeclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/build.properties000066400000000000000000000003731211072747000325610ustar00rootroot00000000000000source.. = src/ output.. = bin/ bin.includes = plugin.xml,\ META-INF/,\ .,\ help/,\ *.xml,\ OSGI-INF/l10n/bundle.properties,\ icons/,\ templates/ eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/help/000077500000000000000000000000001211072747000302715ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/help/general.html000066400000000000000000000026041211072747000325760ustar00rootroot00000000000000 General information

General information

What is Pkg-config?

Pkg-config utility outputs the necessary compiler and linker flags needed to build a given package.

Features

The plug-in will set compiler and linker flags automatically that GCC needs in order to build the selected packages - specifically include paths, libraries and their paths, and some other GCC flags.

Property page

Selecting packages happens through Pkg-config property tab where all packages found by pkg-config utility are shown along their descriptions. One can find project specific pkg-config property tab by navigating to Properties -> C/C++ Build -> Settings -> Pkg-config.

Preference page

Pkg-config preference page can be used to change environment variables for PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR. These environment variables are only visible to Eclipse. One shall remember that the pkg-config path cannot contain white spaces (a feature of pkg-config utility). Pkg-config preference page can be found by navigating to Window -> Preferences -> Pkg-config. Note that PKG_CONFIG_PATH can be left blank if pkg-config is found in PATH environment variable.

eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/help/howto.html000066400000000000000000000040451211072747000323220ustar00rootroot00000000000000 How to use

How to use

Requirements

The following must be installed:

Property page

Accessing the property page

You can access the Pkg-config property tab by selecting a project in the workspace and alternatively either click Project -> Properties in the menubar or simply right click the project and choose Properties. From the property page navigate C/C++ Build -> Setting -> Pkg-config tab.

Functionality of the property page

The property page lists all packages that were found by pkg-config utility. By checking a package or multiple of them the compiler and linker flags are automatically set to the active build configuration. Unchecking of packages will remove those flags from the build configuration that are not needed by other checked packages. Pressing the OK button closes the property page and starts rebuilding the index.

Preference page

It is possible to set PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR environment variables from the Pkg-config preference page. The page can be accessed by clicking Window -> Preferences -> Pkg-config in the menubar. Note that PKG_CONFIG_PATH can be left blank if pkg-config is found in PATH environment variable.

PKG_CONFIG_PATH is a list of directories to search for .pc files.
PKG_CONFIG_LIBDIR replaces the default pkg-config search directory.

Building program code

After the packages that the code depends on are checked on the property page everything is set. Rebuilding the index may take some time depending on the size of your codebase. When you see zero unresolved inclusions you are ready to build the program code whenever you want. eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/help/toc.html000066400000000000000000000006231211072747000317450ustar00rootroot00000000000000 Table of Contents

PKG-CONFIG support

Table of Contents

eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/help/toc.xml000066400000000000000000000004031211072747000315750ustar00rootroot00000000000000 eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/icons/000077500000000000000000000000001211072747000304545ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/icons/icon.png000066400000000000000000000164131211072747000321170ustar00rootroot00000000000000PNG  IHDR2(rL pHYs.#.#x?v OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F6IDATxܙy]}?g[fΐQ$%J",ےr:v #Ңi E G6 [HNUu6;ɒ-$ƔI.ÙoݳG -E4=9{}!C=ا_ǟtޱccb7W+nFFe=WtsG?MnڏϮ_;1}'>cKs I^>m0-G};ƶ8 ]@=``U={jw1Z+kI1A"Y5x6 >C@ΡTPJbʿ ߪK/K|s~zh'cct\ZQ(h8C .`raQAC^ZT@ )$BJ RIH<|m~yo /яT5qJy~~'?M xgщDDH:y˜{ ㈴RF ٻB HB"O_x=[{꩟LNvͱrO|x?Ǧ߃m@A'6 .RhJ*|oexg2 DjA@#5RnV×_>/~s 'NnLqɏ~Yi?EIAR(RBp8 !xHeo\AD@kEhJ`ȥ+쿧BCHĎQj/>sb{?cͭ"uDЅBX Uh48?}+st:-ktڛ$_X -ĉJ&ϻf /U,d JID= ZGx_Bk F\#.!"r8s,gN\YYP2e r*"xD`G GnA(R*I"g@^}iZEKk,N Hq^II&v?h5ff&k7Y_h#vNI zAJJI:#"@8I(er؉t. [j+uHuTd0X7/HtLH!;"PQ#-_~Aglb21>̥LEN;yBy$#}ln^a[XUG8 Em:Bu+ZVCb8sid0V;}zIo X)Vv:R"CJ{<$b).^ !NPQ Re"o^ĪQ./hX%#tav>r~zu% 1CP֒G"rWnI3!y9oZI  *f|k @RTIJ `%V% MbG2{P{C?^r͍UvH`H brwPRR,h6E)\Zdd|{i$Effoģ}c i!!%{sR :K;G {]G^qlkXcA꽋"Nt/wwv'CC~cUۃ!@zDpskBͱsJQɍØH H@IboB~G9|컧rh5J%Fyi!(Ee]kw NJnLMN':@@+FKz>HYS+Ur [Wow[ W~`csqwcx`0;GDJՋ5Ι s|xs۝X/Cisp+&reD:f=yiMrky"wO$vc(0ɻ]R!FHY}3k+}#;B LMP*H 2Tj6B:8H \yP&onlO'c Wns\[QZم%"gr8(>ŅyTB~`8xVW9o13ϱcBx0D/QIA"@ \N?nub;jɍctpz;1P,ɲ"o,!ޞ{s ? ,zpم5>=SllsQvȭ:FŵfBȶ-"@hJKRC=`VsnvYF#f{0"u"^ha_R ń5L&68(>bfӑurne6 K 5Q'RvݹsK[ Y&IҴB&^F|b*y:Շw(`sCiG~s݋Jɻ$ssz)R%`mmf3K*+-= EQ*IO4qRV߼tiŭ$/$)n8 eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/pom.xml000066400000000000000000000017471211072747000306670ustar00rootroot00000000000000 4.0.0 org.eclipse.cdt.managedbuilder.pkgconfig.parent pkgconfig-parent 0.8.0-SNAPSHOT ../org.eclipse.cdt.managedbuilder.pkgconfig.build org.eclipse.cdt.managedbuilder.pkgconfig eclipse-plugin 0.8.0-SNAPSHOT src **/*.java eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/000077500000000000000000000000001211072747000301305ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/000077500000000000000000000000001211072747000307175ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/000077500000000000000000000000001211072747000323435ustar00rootroot00000000000000000077500000000000000000000000001211072747000330365ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt000077500000000000000000000000001211072747000360015ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder000077500000000000000000000000001211072747000377505ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfigActivator.java000066400000000000000000000135611211072747000425550ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig; import java.io.IOException; import java.util.PropertyResourceBundle; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.pkgconfig.settings.PkgConfigExternalSettingProvider; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { //Plug-in ID public static final String PLUGIN_ID = "org.eclipse.cdt.managedbuilder.pkgconfig"; //$NON-NLS-1$ //Tool ID public static final String TOOL_ID = "org.eclipse.cdt.managedbuilder.pkgconfig.tool"; //$NON-NLS-1$ //Shared instance private static Activator plugin; //Name for the properties file private final static String PROPERTIES = "plugin.properties"; //$NON-NLS-1$ //Property Resource bundle private PropertyResourceBundle properties; private ICProjectDescriptionListener listener; /** * The constructor */ public Activator() { super(); plugin = this; } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) */ @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; this.listener = new ICProjectDescriptionListener() { // Handle the configuration updates in order to clear the pkg // config settings (eg. if a new toolchain is selected, the pkg // config settings will be updated after the user apply the // changes even if he does not go through the pkg config // property tab) @Override public void handleEvent(CProjectDescriptionEvent event) { // Get the configuration description of the updated project IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(event .getProject()); IConfiguration cfg = info.getDefaultConfiguration(); ICProjectDescription projDesc = CoreModel.getDefault() .getProjectDescription(event.getProject(), true); final ICConfigurationDescription confDesc = projDesc .getConfigurationById(cfg.getId()); Job j = new Job("Update Pkg-config external settings provider") { //$NON-NLS-1$ @Override protected IStatus run(IProgressMonitor monitor) { // update external setting providers confDesc.updateExternalSettingsProviders(new String[] { PkgConfigExternalSettingProvider.ID }); return Status.OK_STATUS; } }; j.setPriority(Job.INTERACTIVE); j.schedule(); } }; // Listen for the configuration updates (toolchain updates are important // for us as the pkg-config plugin depends on the select toolchain) CoreModel.getDefault().addCProjectDescriptionListener(this.listener, CProjectDescriptionEvent.DATA_APPLIED); } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) */ @Override public void stop(BundleContext context) throws Exception { plugin = null; CoreModel.getDefault().removeCProjectDescriptionListener(this.listener); super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } /** * Returns an image descriptor for the image file at the given * plug-in relative path * * @param path the path * @return the image descriptor */ public static ImageDescriptor getImageDescriptor(String path) { return imageDescriptorFromPlugin(PLUGIN_ID, path); } /** * Get plugin.properties * * @return PropertyResourceBundle */ public PropertyResourceBundle getProperties(){ if (this.properties == null){ try { this.properties = new PropertyResourceBundle( FileLocator.openStream(this.getBundle(), new Path(PROPERTIES),false)); } catch (IOException e) { Activator.getDefault().log(e, "Creating a PropertyResourceBundle failed."); //$NON-NLS-1$ } } return this.properties; } /** * Log error. * * @param e */ public void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); //$NON-NLS-1$ } /** * Log status. * * @param status */ public void log(IStatus status) { getLog().log(status); } /** * Log Status, plug-in id, message and exception. * * @param status * @param e * @param message */ public void log(int status, Exception e, String message) { getLog().log(new Status(status, PLUGIN_ID, message, e)); } /** * Log plug-in id, message and exception. * * @param e * @param message */ public void log(Exception e, String message) { getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e)); } } 000077500000000000000000000000001211072747000422515ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferencesLibDirFieldEditor.java000066400000000000000000000070611211072747000464000ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import java.io.File; import org.eclipse.jface.preference.StringButtonFieldEditor; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DirectoryDialog; public class LibDirFieldEditor extends StringButtonFieldEditor { /** * Initial path for the Browse dialog. */ private File filterPath = null; /** * Creates a lib dir editor */ protected LibDirFieldEditor() { } /** * Creates a lib dir editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control */ public LibDirFieldEditor(String name, String labelText, Composite parent) { init(name, labelText); setErrorMessage(JFaceResources .getString("DirectoryFieldEditor.errorMessage"));//$NON-NLS-1$ setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$ setValidateStrategy(VALIDATE_ON_FOCUS_LOST); createControl(parent); } /** * Helper that opens the directory chooser dialog. * @param startingDirectory The directory the dialog will open in. * @return File File or null. * */ private File getDirectory(File startingDirectory) { DirectoryDialog fileDialog = new DirectoryDialog(getShell(), SWT.OPEN | SWT.SHEET); if (startingDirectory != null) { fileDialog.setFilterPath(startingDirectory.getPath()); } else if (this.filterPath != null) { fileDialog.setFilterPath(this.filterPath.getPath()); } String dir = fileDialog.open(); if (dir != null) { dir = dir.trim(); if (dir.length() > 0) { return new File(dir); } } return null; } @Override /* (non-Javadoc) * Method declared on StringButtonFieldEditor. * Opens the directory chooser dialog and returns the selected directory. */ protected String changePressed() { File f = new File(getTextControl().getText()); if (!f.exists()) { f = null; } File d = getDirectory(f); if (d == null) { return null; } return d.getAbsolutePath(); } @Override /* (non-Javadoc) * Method declared on StringFieldEditor. * Checks whether the text input field contains a valid directory. */ protected boolean doCheckState() { String fileName = getTextControl().getText(); fileName = fileName.trim(); if (fileName.length() == 0 && isEmptyStringAllowed()) { return true; } File file = new File(fileName); return file.isDirectory(); } /** * Sets the initial path for the Browse dialog. * @param path initial path for the Browse dialog * @since 3.6 */ public void setFilterPath(File path) { this.filterPath = path; } } Messages.java000066400000000000000000000026371211072747000446730ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.pkgconfig.preferences.messages"; //$NON-NLS-1$ public static String PkgConfigSettingsDialog_0; public static String PkgConfigSettingsDialog_1; public static String PkgConfigSettingsDialog_2; public static String PkgConfigPropertyTab_0; public static String PkgConfigPathListEditor_0; public static String PkgConfigPathListEditor_1; public static String PreferencePage_0; public static String PreferencePage_1; public static String PreferencePage_2; public static String PreferencePage_3; public static String PreferencePage_4; public static String PreferencePage_5; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages() { } } PkgConfigListEditor.java000066400000000000000000000207331211072747000467730ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import java.util.regex.Pattern; import org.eclipse.cdt.managedbuilder.pkgconfig.util.Separators; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.preference.ListEditor; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Widget; /** * An abstract list editor that manages a list of input values. * The editor displays a list containing the values, buttons for adding and removing * values, and Up and Down buttons to adjust the order of elements in the list. * */ public abstract class PkgConfigListEditor extends ListEditor { /** * The list widget; null if none * (before creation or after disposal). */ List list; /** * The button box containing the Add and Remove buttons; * null if none (before creation or after disposal). */ Composite buttonBox; Button addButton; Button removeButton; /** * The selection listener. */ private SelectionListener selectionListener; /** * Creates a list field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control */ protected PkgConfigListEditor(String name, String labelText, Composite parent) { super(name, labelText, parent); } @Override /** * Combines the given list of items into a single String. * This method is the converse of parseString. */ protected String createList(String[] items) { StringBuilder stringBuilder = new StringBuilder(); for (String item : items) { if (stringBuilder.length() > 0) { stringBuilder.append(Separators.getPathSeparator()); } stringBuilder.append(item); } return stringBuilder.toString(); } @Override /** Splits the given String into a list of Strings. * This method is the converse of createList. */ protected String[] parseString(String stringList) { if (stringList != null && stringList.length() > 0) { return stringList.split(Pattern.quote(Separators.getPathSeparator())); } return new String[0]; } /** * Creates the Add, Remove, Up, and Down button in the given button box. * * @param box the box for the buttons */ private void createButtons(Composite box) { this.addButton = createPushButton(box, "ListEditor.add");//$NON-NLS-1$ this.removeButton = createPushButton(box, "ListEditor.remove");//$NON-NLS-1$ } /** * Helper method to create a push button. * * @param parent the parent control * @param key the resource name used to supply the button's label text * @return Button */ private Button createPushButton(Composite parent, String key) { Button button = new Button(parent, SWT.PUSH); button.setText(JFaceResources.getString(key)); button.setFont(parent.getFont()); GridData data = new GridData(GridData.FILL_HORIZONTAL); int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH); data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); button.setLayoutData(data); button.addSelectionListener(getSelectionListener()); return button; } /** * Creates a selection listener. */ @Override public void createSelectionListener() { this.selectionListener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { Widget widget = event.widget; if (widget == PkgConfigListEditor.this.addButton) { addPressed(); } else if (widget == PkgConfigListEditor.this.removeButton) { removePressed(); } else if (widget == PkgConfigListEditor.this.list) { selectionChanged(); } } }; } /** * Returns this field editor's button box containing the Add, Remove, * Up, and Down button. * * @param parent the parent control * @return the button box */ @Override public Composite getButtonBoxControl(Composite parent) { if (this.buttonBox == null) { this.buttonBox = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.marginWidth = 0; this.buttonBox.setLayout(layout); createButtons(this.buttonBox); this.buttonBox.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent event) { PkgConfigListEditor.this.addButton = null; PkgConfigListEditor.this.removeButton = null; PkgConfigListEditor.this.buttonBox = null; } }); } else { checkParent(this.buttonBox, parent); } selectionChanged(); return this.buttonBox; } /** * Returns this field editor's list control. * * @param parent the parent control * @return the list control */ @Override public List getListControl(Composite parent) { if (this.list == null) { this.list = new List(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); this.list.setFont(parent.getFont()); this.list.addSelectionListener(getSelectionListener()); this.list.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent event) { PkgConfigListEditor.this.list = null; } }); } else { checkParent(this.list, parent); } return this.list; } /** * Returns this field editor's selection listener. The listener is created if nessessary. * @return the selection listener */ private SelectionListener getSelectionListener() { if (this.selectionListener == null) { createSelectionListener(); } return this.selectionListener; } /** * Invoked when the selection in the list has changed. * *

* The default implementation of this method utilizes the selection index * and the size of the list to toggle the enablement of the up, down and * remove buttons. *

* */ @Override protected void selectionChanged() { int index = this.list.getSelectionIndex(); this.removeButton.setEnabled(index >= 0); } /** * Returns this field editor's shell. *

* This method is internal to the framework; subclasses should not call * this method. *

* * @return the shell */ @Override protected Shell getShell() { if (this.addButton == null) { return null; } return this.addButton.getShell(); } /** * Notifies that the Add button has been pressed. */ void addPressed() { setPresentsDefaultValue(false); String input = getNewInputObject(); if (input != null) { int index = this.list.getSelectionIndex(); if (index >= 0) { this.list.add(input, index + 1); } else { this.list.add(input, 0); } selectionChanged(); } } /** * Notifies that the Remove button has been pressed. */ protected abstract void removePressed(); } PkgConfigPathListEditor.java000066400000000000000000000055211211072747000476060ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation * Melanie Bats - Pkg-config variables can be set by project *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Text; /** * New implementation of PkgConfigListEditor. * Used to select PKG_CONFIG_PATH values from the dialog. */ public class PkgConfigPathListEditor extends PkgConfigListEditor { /** * Constructor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param parent the parent of the field editor's control */ public PkgConfigPathListEditor(String name, String labelText, Composite parent) { super(name, labelText, parent); } @Override /** * Functionality for New button. * Shows a browse dialog to select a directory and returns that directory path. */ protected String getNewInputObject() { DirectoryDialog dlg = new DirectoryDialog(getShell()); final Text text = new Text(getShell(), SWT.BORDER); dlg.setFilterPath(text.getText()); dlg.setText(Messages.PkgConfigPathListEditor_0); dlg.setMessage(Messages.PkgConfigPathListEditor_1); String dir = dlg.open(); if(dir == null) { return null; } //remove white spaces dir = dir.trim(); if (dir.length()!=0) { //get all existing items in the list String[] existingItems = getList().getItems(); //check that the list doesn't already contain the added item if (existingItems.length>0) { //return null if duplicate item found for (String item : existingItems) { if (item.equalsIgnoreCase(dir)) { return null; } } } return dir; } return null; } @Override /** * Removes the path from the list as well as from the Tool's Option. */ protected void removePressed() { List incList = getList(); setPresentsDefaultValue(false); String[] selected = incList.getSelection(); for (String s : selected) { incList.remove(s); selectionChanged(); } } /** * Get the pkg config paths. * * @return Array of pkg-config paths */ public String[] getPkgConfigPaths() { return getList().getItems(); } public void setData(String[] pkgConfigs) { getList().setItems(pkgConfigs); } }PkgConfigSettingsDialog.java000066400000000000000000000217301211072747000476270ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2012 Melanie Bats and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Melanie Bats - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.ITool; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.PreferenceStore.PkgConfigExecutable; import org.eclipse.cdt.ui.newui.AbstractPropertyDialog; import org.eclipse.core.resources.IProject; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class PkgConfigSettingsDialog extends AbstractPropertyDialog { private static final String UNSET_PKG_CONFIG = ""; //$NON-NLS-1$ private static final String PKG_CONFIG_PATH = Messages.PkgConfigSettingsDialog_0; private static final String PKG_CONFIG_LIBDIR = Messages.PkgConfigSettingsDialog_1; private Combo pkgConfigPathKindCombo; private PkgConfigPathListEditor configPathListEditor; private Button buttonOk; private Button buttonCancel; protected String projectName; protected IProject project; protected String selectedFile; private Button radioDefault; private Button radioCustom; public PkgConfigSettingsDialog(Shell _parent, String title, IProject project) { super(_parent, title); this.project = project; this.projectName = project.getName(); } @Override public void buttonPressed(SelectionEvent e) { if (e.widget.equals(this.buttonOk)) { if (this.radioCustom.getSelection() && this.selectedFile != null) { PreferenceStore.setPkgConfigExecutable(PkgConfigExecutable.Custom, PkgConfigSettingsDialog.this.projectName); PreferenceStore.setPkgConfigBinPath(this.selectedFile, PkgConfigSettingsDialog.this.projectName); }else{ PreferenceStore.setPkgConfigExecutable(PkgConfigExecutable.Default, PkgConfigSettingsDialog.this.projectName); // Search if a toolchain tool defines the pkg-config tool bin // path String pkgConfigPath = UNSET_PKG_CONFIG; IManagedBuildInfo info = ManagedBuildManager .getBuildInfo(PkgConfigSettingsDialog.this.project); if (info != null) { for (ITool tool : info .getDefaultConfiguration() .getToolChain() .getToolsBySuperClassId( Activator.TOOL_ID)) { pkgConfigPath = tool.getToolCommand(); } } PreferenceStore.setPkgConfigBinPath(pkgConfigPath, PkgConfigSettingsDialog.this.projectName); } String pkgConfigPathKind = this.pkgConfigPathKindCombo.getText(); PreferenceStore.clearPkgConfigLibDir(this.projectName); PreferenceStore.clearPkgConfigPath(this.projectName); if (pkgConfigPathKind.length() != 0) { for (String pkgConfigPath : this.configPathListEditor .getPkgConfigPaths()) { if (PKG_CONFIG_PATH.equals(pkgConfigPathKind)) { PreferenceStore.setPkgConfigPath(pkgConfigPath, this.projectName); } else if (PKG_CONFIG_LIBDIR.equals(pkgConfigPathKind)) { PreferenceStore.setPkgConfigLibDir(pkgConfigPath, this.projectName); } } } } this.shell.dispose(); } @Override protected Control createDialogArea(Composite parent) { this.shell.setSize(700, 350); GridLayout gridLayout = new GridLayout(); parent.setLayout(gridLayout); Composite composite = new Composite(parent, SWT.None); GridData layoutData = new GridData(GridData.FILL_BOTH); composite.setLayoutData(layoutData); composite.setLayout(new GridLayout(1, false)); Group group = new Group(composite, SWT.NONE); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); group.setLayout(new GridLayout(2, false)); group.setText(Messages.PreferencePage_3); this.radioDefault = new Button(group, SWT.RADIO); GridData layoutData1 = new GridData(GridData.FILL_BOTH); layoutData1.horizontalSpan = 2; this.radioDefault.setLayoutData(layoutData1); boolean isDefaultPkgConfigExecutableSelected = PreferenceStore.isPkgConfigExecutableDefault(this.projectName); this.radioDefault.setSelection(isDefaultPkgConfigExecutableSelected); this.radioDefault.setText(Messages.PreferencePage_4); this.radioCustom = new Button(group, SWT.RADIO); this.radioCustom.setSelection(!isDefaultPkgConfigExecutableSelected); this.radioCustom.setText(Messages.PreferencePage_5); final Button browseButton = new Button(group, SWT.PUSH); browseButton.setText("Browse..."); //$NON-NLS-1$ browseButton.setEnabled(!isDefaultPkgConfigExecutableSelected); browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { String pkgConfigBinPath = PreferenceStore .getPkgConfigBinPath(PkgConfigSettingsDialog.this.projectName); FileDialog dialog = new FileDialog( PkgConfigSettingsDialog.this.shell, SWT.OPEN); dialog.setFileName(pkgConfigBinPath); PkgConfigSettingsDialog.this.selectedFile = dialog.open(); } }); this.radioDefault.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browseButton.setEnabled(false); } }); this.radioCustom.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { browseButton.setEnabled(true); } }); Group group2 = new Group(composite, SWT.NONE); group2.setLayoutData(layoutData); group2.setLayout(new GridLayout(2, false)); Label comboLabel = new Label(group2, SWT.WRAP); GridData comboLabelLayout = new GridData(); comboLabel.setLayoutData(comboLabelLayout); comboLabel.setText(Messages.PkgConfigSettingsDialog_2); this.pkgConfigPathKindCombo = new Combo(group2, SWT.BORDER | SWT.READ_ONLY); GridData comboLayout = new GridData(GridData.FILL_HORIZONTAL); this.pkgConfigPathKindCombo.setItems(new String[] { UNSET_PKG_CONFIG, PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR }); this.pkgConfigPathKindCombo.setLayoutData(comboLayout); // Get pkg-config path and pkg-config libdir for the current project String[] pkgConfigPath = PreferenceStore .getPkgConfigPath(this.projectName); String[] pkgConfigLibDir = PreferenceStore .getPkgConfigLibDir(this.projectName); Composite composite2 = new Composite(group2, SWT.None); GridData layoutData2 = new GridData(GridData.FILL_BOTH); layoutData2.horizontalAlignment = SWT.FILL; layoutData2.horizontalSpan = 3; composite2.setLayoutData(layoutData2); composite2.setLayout(new GridLayout(2, false)); this.configPathListEditor = new PkgConfigPathListEditor( PreferenceConstants.PKG_CONFIG_PATH, "", composite2); //$NON-NLS-1$ // Initialize combo to current value if (pkgConfigLibDir != null) { // Select lib dir this.pkgConfigPathKindCombo.select(2); this.configPathListEditor.setData(pkgConfigLibDir); } else if (pkgConfigPath != null) { // Select config path this.pkgConfigPathKindCombo.select(1); this.configPathListEditor.setData(pkgConfigPath); } else { // None this.pkgConfigPathKindCombo.select(0); this.pkgConfigPathKindCombo.setData(UNSET_PKG_CONFIG); } // Buttons Composite compButtons = new Composite(composite, SWT.FILL); GridData gd = new GridData(SWT.RIGHT, SWT.BOTTOM, true, false); gd.horizontalSpan = 4; compButtons.setLayoutData(gd); compButtons.setLayout(new GridLayout(2, true)); // Button Cancel this.buttonCancel = new Button(compButtons, SWT.PUSH); this.buttonCancel.setText(IDialogConstants.CANCEL_LABEL); gd = new GridData(GridData.FILL_HORIZONTAL); this.buttonCancel.setLayoutData(gd); this.buttonCancel.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { buttonPressed(event); } }); // Button OK this.buttonOk = new Button(compButtons, SWT.PUSH); this.buttonOk.setText(IDialogConstants.OK_LABEL); gd = new GridData(GridData.FILL_HORIZONTAL); this.buttonOk.setLayoutData(gd); this.buttonOk.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { buttonPressed(event); } }); parent.getShell().setDefaultButton(this.buttonOk); return parent; } } PreferenceConstants.java000066400000000000000000000020451211072747000470700ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; public class PreferenceConstants { public static final String PKG_CONFIG_PATH = "A colon-separated" + //$NON-NLS-1$ " (on Windows, semicolon-separated) list of directories" + //$NON-NLS-1$ " to search for .pc files."; //$NON-NLS-1$ public static final String PKG_CONFIG_LIBDIR = "Replaces the" + //$NON-NLS-1$ " default pkg-config search directory."; //$NON-NLS-1$ public static final String PKG_CONFIG_BIN = "Path to the pkg-config executable"; //$NON-NLS-1$ }PreferenceInitializer.java000066400000000000000000000026021211072747000473760ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; /** * Class used to initialize the default preference values. * */ public class PreferenceInitializer extends AbstractPreferenceInitializer { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() */ @Override public void initializeDefaultPreferences() { IEclipsePreferences store = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); store.put(PreferenceConstants.PKG_CONFIG_PATH, ""); //$NON-NLS-1$ store.put(PreferenceConstants.PKG_CONFIG_LIBDIR, ""); //$NON-NLS-1$ } }PreferenceStore.java000066400000000000000000000163561211072747000462220ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferences/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.preferences; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.cdt.managedbuilder.pkgconfig.util.ArrayUtil; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; /** * Class used to access the Pkg-config preference store values. * * This class is not intended to be subclassed by clients. */ public class PreferenceStore { private static final String PATH_SEPARATOR = ";"; //$NON-NLS-1$ private static final String PKG_CONFIG_BIN_KIND = "PKG_CONFIG_BIN_KIND"; //$NON-NLS-1$ private static final String PKG_CONFIG_BIN = "PKG_CONFIG_BIN"; //$NON-NLS-1$ private static final String PKG_CONFIG_LIBDIR = "PKG_CONFIG_LIBDIR"; //$NON-NLS-1$ private static final String PKG_CONFIG_PATH = "PKG_CONFIG_PATH"; //$NON-NLS-1$ public enum PkgConfigExecutable { Default, Custom } /** * Get the Pkg-config preference store. * * @return Pkg-config preference store. */ public static IEclipsePreferences getPreferenceStore() { IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); return prefs; } /** * Get a value from the preference store. * * @param name the name of the preference * @return the string-valued preference */ public static String getPreferenceStoreValue(String name) { return getPreferenceStore().get(name, ""); //$NON-NLS-1$ } /** * Set preference store value. * * @param name the name of the preference * @param value the string-valued preference */ public static void setPreferenceStoreValue(String name, String value) { getPreferenceStore().put(name, value); } /** * Clear preference store value. * * @param name * the name of the preference */ public static void clearPreferenceStoreValue(String name) { getPreferenceStore().put(name, ""); //$NON-NLS-1$ } /** * Set pkg-config executable type to the preference store. * * @param pkgConfigExecutable * The pkg-config executable. * @param project */ public static void setPkgConfigExecutable( PkgConfigExecutable pkgConfigExecutable, String project) { setPreferenceStoreValue(getPkgConfigExecutableKey(project), pkgConfigExecutable.toString()); } /** * Is pkg-config executable set to default in the preference store. * * @return True if the executable to use is the deafult one else return false to use the custom. */ public static boolean isPkgConfigExecutableDefault(String project) { return !PkgConfigExecutable.Custom.name().equals( getPreferenceStoreValue(getPkgConfigExecutableKey(project))); } /** * Set pkg-config bin to the preference store. * * @param path * The pkg-config bin. * @param project */ public static void setPkgConfigBinPath(String path, String project) { setPreferenceStoreValue(getPkgConfigBinKey(project), path); } /** * Get pkg-config bin path from the preference store. * * @return pkg-config bin path. */ public static String getPkgConfigBinPath(String project) { return getPreferenceStoreValue(getPkgConfigBinKey(project)); } /** * Get pkg-config path from the preference store. * * @return pkg-config path. */ public static String[] getPkgConfigPath(String project) { String pkgConfigPathStringValue = getPreferenceStoreValue(getPkgConfigPathKey(project)); if (pkgConfigPathStringValue.length() == 0) return null; return pkgConfigPathStringValue.split(PATH_SEPARATOR); } /** * Set pkg-config path to the preference store. * * @param path The pkg-config path * @param project The project name */ public static void setPkgConfigPath(String path, String project) { String pkgConfigPath = getPreferenceStoreValue(getPkgConfigPathKey(project)); if (pkgConfigPath.length() != 0) { pkgConfigPath += PATH_SEPARATOR; } setPreferenceStoreValue(getPkgConfigPathKey(project), pkgConfigPath + path); } /** * Get pkg-config libdir from the preference store. * * @return pkg-config libdir. */ public static String[] getPkgConfigLibDir(String project) { String pkgConfigLibDirStringValue = getPreferenceStoreValue(getPkgConfigLibDirKey(project)); if (pkgConfigLibDirStringValue.length() == 0) return null; return pkgConfigLibDirStringValue.split(PATH_SEPARATOR); } /** * Set pkg-config libdir to the preference store. * * @param path The pkg-config libdir * @param project The project name */ public static void setPkgConfigLibDir(String path, String project) { String pkgConfigPath = getPreferenceStoreValue(getPkgConfigLibDirKey(project)); if (pkgConfigPath.length() != 0) { pkgConfigPath += PATH_SEPARATOR; } setPreferenceStoreValue(getPkgConfigLibDirKey(project), pkgConfigPath + path); } /** * Clear pkg-config path to the preference store. * * @param project * The project name */ public static void clearPkgConfigPath(String project) { clearPreferenceStoreValue(getPkgConfigPathKey(project)); } /** * Clear pkg-config libdir path to the preference store. * * @param project * The project name */ public static void clearPkgConfigLibDir(String project) { clearPreferenceStoreValue(getPkgConfigLibDirKey(project)); } /** * Get values from the preference store as a String array. Used to get * preference store values which consist of multiple paths separated by a * path separator. * * @param name * the name of the preference * @return A String array containing all preference store values */ public static String[] getPreferenceStoreValueAsArray(String name) { return ArrayUtil.stringToArray(name); } /** * Compute the key for the given pkg-config binary and the given project. * * @param project * Project name * @return Key */ private static String getPkgConfigBinKey(String project) { return PKG_CONFIG_BIN + " - " //$NON-NLS-1$ + project; } /** * Compute the key for the given pkg-config binary kind and the given * project. * * @param project * Project name * @return Key */ private static String getPkgConfigExecutableKey(String project) { return PKG_CONFIG_BIN_KIND + " - " //$NON-NLS-1$ + project; } /** * Compute the key for the given pkg-config lib dir and the given project. * * @param project * Project name * @return Key */ private static String getPkgConfigLibDirKey(String project) { return PKG_CONFIG_LIBDIR + " - " //$NON-NLS-1$ + project; } /** * Compute the key for the given pkg-config path and the given project. * * @param project * Project name * @return Key */ private static String getPkgConfigPathKey(String project) { return PKG_CONFIG_PATH + " - " //$NON-NLS-1$ + project; } }messages.properties000066400000000000000000000010711211072747000461750ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/preferencesPreferencePage_0=Preferences for Pkg-config PreferencePage_1=PKG_CONFIG_PATH: PreferencePage_2=PKG_CONFIG_LIBDIR (replaces default): PreferencePage_3=Path to pkg-config executable: PreferencePage_4=Default from toolchain PreferencePage_5=Custom PkgConfigPathListEditor_0=Browse a directory path PkgConfigPathListEditor_1=Select a directory PkgConfigPropertyTab_0=Pkg-config project settings PkgConfigSettingsDialog_0=Append to (PKG_CONFIG_PATH) PkgConfigSettingsDialog_1=Replace (PKG_CONFIG_LIBDIR) PkgConfigSettingsDialog_2=Adjust the default pkg-config search path : 000077500000000000000000000000001211072747000421445ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/propertiesDataModel.java000066400000000000000000000016371211072747000446500ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/properties/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.properties; public class DataModel { private String pkg; private String desc; public DataModel(String pkg, String desc) { super(); this.pkg = pkg; this.desc = desc; } public String getPackage() { return this.pkg; } public String getDescription() { return this.desc; } @Override public String toString() { return this.pkg; } }DataModelProvider.java000066400000000000000000000042571211072747000463640ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/properties/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.properties; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import org.eclipse.cdt.managedbuilder.pkgconfig.util.Parser; import org.eclipse.cdt.managedbuilder.pkgconfig.util.PkgConfigUtil; public class DataModelProvider { List dms; /** * Initialize. * @param project Project */ DataModelProvider(String project) { this.dms = new ArrayList(); List packages = PkgConfigUtil.getAllPackages(project); List pkgList = Parser.parsePackageList(packages); List nonSortedPkgList = Parser.parsePackageList(packages); HashMap origSortedIdx = new HashMap(); Collections.sort(pkgList, String.CASE_INSENSITIVE_ORDER); int sortedIdx; for (int i=0; i descs = Parser.parseDescription(packages); int cellPlace; String[] sortedArray = new String[descs.size()]; for (int i=0; i descList = Arrays.asList(sortedArray); for (int i=0; i getEntries() { return this.dms; } }PkgConfigPropertyTab.java000066400000000000000000000420371211072747000470600ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/properties/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.properties; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICResourceDescription; import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.ITool; import org.eclipse.cdt.managedbuilder.core.IToolChain; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.LibDirFieldEditor; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.Messages; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.PkgConfigPathListEditor; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.PkgConfigSettingsDialog; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.PreferenceStore; import org.eclipse.cdt.managedbuilder.pkgconfig.settings.PkgConfigExternalSettingProvider; import org.eclipse.cdt.managedbuilder.pkgconfig.util.Parser; import org.eclipse.cdt.managedbuilder.pkgconfig.util.PathToToolOption; import org.eclipse.cdt.managedbuilder.pkgconfig.util.PkgConfigUtil; import org.eclipse.cdt.ui.newui.AbstractCPropertyTab; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; /** * Property tab to select packages and add pkg-config output of checked packages * to compiler and linker (MBS). * */ public class PkgConfigPropertyTab extends AbstractCPropertyTab { PkgConfigPathListEditor configPathListEditor; LibDirFieldEditor libDirEditor; CheckboxTableViewer pkgCfgViewer; private Set previouslyChecked; private ArrayList newItems = new ArrayList(); private static final int BUTTON_SELECT = 0; private static final int BUTTON_DESELECT = 1; private static final int BUTTON_ADVANCED = 2; private final String PACKAGES = "packages"; //$NON-NLS-1$ private boolean reindexToggle = false; private SashForm sashForm; private static final String[] BUTTONS = new String[] { "Select", //$NON-NLS-1$ "Deselect", //$NON-NLS-1$ "Advanced..." //$NON-NLS-1$ }; private IToolChain selectedToolChain; /* * (non-Javadoc) * * @see * org.eclipse.cdt.ui.newui.AbstractCPropertyTab#createControls(org.eclipse * .swt.widgets.Composite) */ @Override public void createControls(Composite parent) { super.createControls(parent); this.usercomp.setLayout(new GridLayout(1, false)); this.sashForm = new SashForm(this.usercomp, SWT.NONE); this.sashForm.setBackground(this.sashForm.getDisplay().getSystemColor( SWT.COLOR_GRAY)); this.sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, false); layout.marginHeight = 5; this.sashForm.setLayout(layout); final Composite c1 = new Composite(this.sashForm, SWT.NONE); GridLayout layout2 = new GridLayout(3, false); c1.setLayout(layout2); this.pkgCfgViewer = CheckboxTableViewer .newCheckList(c1, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); final Table tbl = this.pkgCfgViewer.getTable(); tbl.setHeaderVisible(true); tbl.setLinesVisible(true); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2; tbl.setLayoutData(gd); createColumns(c1, this.pkgCfgViewer); this.pkgCfgViewer.setContentProvider(new ArrayContentProvider()); this.selectedToolChain = getSelectedToolchain(); updatePkgConfigBinPath(); this.pkgCfgViewer.setInput(new DataModelProvider(this.page.getProject() .getName()).getEntries()); this.pkgCfgViewer.addCheckStateListener(new PkgListener()); this.pkgCfgViewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { TableItem itm = tbl.getSelection()[0]; if (itm.getChecked()) { itm.setChecked(false); } else { itm.setChecked(true); } handleCheckStateChange(); } }); // buttons Composite compositeButtons = new Composite(c1, SWT.NONE); initButtons(compositeButtons, BUTTONS); initializePackageStates(); this.previouslyChecked = new HashSet( Arrays.asList(getCheckedItems())); } @Override public void handleTabEvent(int kind, Object data) { if (this.selectedToolChain != null && this.selectedToolChain.getId() != getSelectedToolchain() .getId()) { this.selectedToolChain = getSelectedToolchain(); updatePkgConfigBinPath(); if (PkgConfigPropertyTab.this.pkgCfgViewer != null) { PkgConfigPropertyTab.this.pkgCfgViewer .setInput(new DataModelProvider( PkgConfigPropertyTab.this.page.getProject() .getName()).getEntries()); PkgConfigPropertyTab.this.pkgCfgViewer.refresh(); } } } /** * Get checked items. * * @return */ private Object[] getCheckedItems() { return this.pkgCfgViewer.getCheckedElements(); } /** * Action for the check state change. */ void handleCheckStateChange() { Object[] checkedItems = getCheckedItems(); // check if new items checked if (checkedItems.length > this.previouslyChecked.size()) { // add checked items to an array list for (Object o : checkedItems) { // if new item if (!this.previouslyChecked.contains(o)) { this.newItems.add(o); } } addPackageValues(this.newItems.toArray(), this.page.getProject()); this.reindexToggle = true; } saveChecked(); updateData(getResDesc()); this.previouslyChecked = new HashSet( Arrays.asList(checkedItems)); this.newItems.clear(); } /** * Add new flags that the packages need to Tools' Options. Only for other * flags. * * @param addedItems * Object[] * @param proj * IProject */ private static void addPackageValues(Object[] addedItems, IProject proj) { for (Object item : addedItems) { // handle options String cflags = PkgConfigUtil.getCflags(item.toString(), proj.getName()); String[] optionsArray = Parser.parseCflagOptions(cflags); if (optionsArray != null) { for (String option : optionsArray) { PathToToolOption.addOtherFlag(option, proj); } } } ManagedBuildManager.saveBuildInfo(proj, true); } /** * Initializes the check state of the packages from the storage. */ private void initializePackageStates() { ICConfigurationDescription desc = getResDesc().getConfiguration(); ICStorageElement strgElem = null; try { strgElem = desc.getStorage(this.PACKAGES, true); TableItem[] items = this.pkgCfgViewer.getTable().getItems(); String value = null; for (TableItem item : items) { /* * The package names with + symbols were converted so that + -> * plus in order to prevent an error when saving to * ICStorageElement. */ if (item.getText().contains("+")) { //$NON-NLS-1$ String newItemName = item.getText().replace("+", "plus"); //$NON-NLS-1$ //$NON-NLS-2$ value = strgElem.getAttribute(newItemName); } else { value = strgElem.getAttribute(item.getText()); } if (value != null) { if (value.equals("true")) { //$NON-NLS-1$ item.setChecked(true); } } } } catch (CoreException e) { Activator.getDefault().log(e, "Initialization of packages failed."); //$NON-NLS-1$ } } /** * Saves checked state of the packages. */ private void saveChecked() { ICConfigurationDescription desc = getResDesc().getConfiguration(); ICStorageElement strgElem = null; // get storage or create one if it doesn't exist try { strgElem = desc.getStorage(this.PACKAGES, true); } catch (CoreException e) { Activator.getDefault().log(e, "Getting packages from the storage failed."); //$NON-NLS-1$ } TableItem[] items = this.pkgCfgViewer.getTable().getItems(); for (TableItem item : items) { if (item != null) { String chkd; // form literal form of boolean state if (item.getChecked()) { chkd = "true"; //$NON-NLS-1$ } else { chkd = "false"; //$NON-NLS-1$ } /* * add package name and the checkbox state to the storage */ try { String pkgName = item.getText(); // need to convert + symbols to "plus" if (pkgName.contains("+")) { //$NON-NLS-1$ String newPkgName = pkgName.replace("+", "plus"); //$NON-NLS-1$ //$NON-NLS-2$ if (strgElem != null) { strgElem.setAttribute(newPkgName, chkd); } } else { if (strgElem != null) { strgElem.setAttribute(pkgName, chkd); } } } catch (Exception e) { Activator.getDefault().log(e, "Setting attribute to ICStorageElement failed."); //$NON-NLS-1$ // Seems like ICStorageElement cannot store Strings with + /* * INVALID_CHARACTER_ERR: An invalid or illegal XML * character is specified. */ } } } } @Override protected void performApply(ICResourceDescription src, ICResourceDescription dst) { updateData(getResDesc()); } @Override protected void performDefaults() { // uncheck every checkbox this.pkgCfgViewer.setCheckedElements(new Object[] {}); // remove values from Tools Options handleCheckStateChange(); } @Override protected void performOK() { // freshen index if new packages have been selected if (this.reindexToggle) { rebuiltIndex(); } this.reindexToggle = false; } @Override protected void updateButtons() { // nothing here } @Override protected void updateData(ICResourceDescription cfg) { final ICConfigurationDescription confDesc = cfg.getConfiguration(); ICProjectDescription projDesc = confDesc.getProjectDescription(); Job j = new Job("Update Pkg-config exernal settings provider") { //$NON-NLS-1$ @Override protected IStatus run(IProgressMonitor monitor) { // a set holding external setting providers Set externalSettingsProviders = new LinkedHashSet( Arrays.asList(confDesc.getExternalSettingsProviderIds())); // remove pkg-config external setting provider externalSettingsProviders .remove(PkgConfigExternalSettingProvider.ID); confDesc.setExternalSettingsProviderIds(externalSettingsProviders .toArray(new String[externalSettingsProviders.size()])); // add pkg-config external setting provider externalSettingsProviders .add(PkgConfigExternalSettingProvider.ID); confDesc.setExternalSettingsProviderIds(externalSettingsProviders .toArray(new String[externalSettingsProviders.size()])); // update external setting providers confDesc.updateExternalSettingsProviders(new String[] { PkgConfigExternalSettingProvider.ID }); return Status.OK_STATUS; } }; j.setPriority(Job.INTERACTIVE); j.schedule(); try { CoreModel.getDefault().setProjectDescription( this.page.getProject(), projDesc); } catch (CoreException e) { Activator.getDefault().log(e, "Setting/updating the project description failed."); //$NON-NLS-1$ } } /** * Check state listener for the table viewer. * */ public class PkgListener implements ICheckStateListener { @Override public void checkStateChanged(CheckStateChangedEvent e) { handleCheckStateChange(); } } /** * Creates table columns, headers and sets the size of the columns. * * @param parent * @param viewer */ private void createColumns( @SuppressWarnings("unused") final Composite parent, @SuppressWarnings("unused") final TableViewer viewer) { String[] titles = { "Packages", "Description" }; //$NON-NLS-1$ //$NON-NLS-2$ int[] bounds = { 200, 450 }; // first column is for the package TableViewerColumn col = createTableViewerColumn(titles[0], bounds[0]); col.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) { DataModel dm = (DataModel) element; return dm.getPackage(); } }); // second column is for the description col = createTableViewerColumn(titles[1], bounds[1]); col.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) { DataModel dm = (DataModel) element; return dm.getDescription(); } }); } /** * Creates a column for the table viewer. * * @param title * @param bound * @return */ private TableViewerColumn createTableViewerColumn(String title, int bound) { final TableViewerColumn viewerColumn = new TableViewerColumn( this.pkgCfgViewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); return viewerColumn; } /** * Get selected item(s). * * @return */ private TableItem[] getSelected() { TableItem[] selected = this.pkgCfgViewer.getTable().getSelection(); return selected; } /* * (non-Javadoc) * * @see org.eclipse.cdt.ui.newui.AbstractCPropertyTab#buttonPressed(int) */ @Override public void buttonPressed(int n) { switch (n) { case BUTTON_SELECT: selectedButtonPressed(); break; case BUTTON_DESELECT: deselectedButtonPressed(); break; case BUTTON_ADVANCED: advancedButtonPressed(); break; default: break; } updateButtons(); } /** * Action for the Select button. */ private void selectedButtonPressed() { TableItem[] selected = getSelected(); for (TableItem itm : selected) { itm.setChecked(true); } handleCheckStateChange(); } /** * Action for the Deselect button. */ private void deselectedButtonPressed() { TableItem[] selected = getSelected(); for (TableItem itm : selected) { itm.setChecked(false); } handleCheckStateChange(); } /** * Action for the Select button. */ private void advancedButtonPressed() { // Create new dialog PkgConfigSettingsDialog dialog = new PkgConfigSettingsDialog( this.usercomp.getShell(), Messages.PkgConfigPropertyTab_0, this.page.getProject()); dialog.open(); if (PkgConfigPropertyTab.this.pkgCfgViewer != null) { // Update pkg-config libraries for the project updatePkgConfigBinPath(); PkgConfigPropertyTab.this.pkgCfgViewer .setInput(new DataModelProvider( PkgConfigPropertyTab.this.page.getProject() .getName()).getEntries()); } } /** * Update the pkg-config path according to the toolchain if the default * toolchain executable is selected by the user in the pkg-config advanced * preferences. */ private void updatePkgConfigBinPath() { // Search if a toolchain tool defines the pkg-config tool bin // path String pkgConfigPath = ""; //$NON-NLS-1$ if (this.page != null && PreferenceStore.isPkgConfigExecutableDefault(this.page .getProject().getName())) { for (ITool tool : this.selectedToolChain .getToolsBySuperClassId("org.eclipse.cdt.managedbuilder.pkgconfig.tool")) { //$NON-NLS-1$ pkgConfigPath = tool.getToolCommand(); } PreferenceStore.setPkgConfigBinPath(pkgConfigPath, this.page .getProject().getName()); } } private IToolChain getSelectedToolchain() { if (this.page != null) { IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(this.page .getProject()); if (info != null) { return info.getDefaultConfiguration().getToolChain(); } } return null; } /** * Rebuilts the index of the selected project in the workspace. */ private void rebuiltIndex() { ICProject cproject = CoreModel.getDefault().getCModel() .getCProject(this.page.getProject().getName()); CCorePlugin.getIndexManager().reindex(cproject); } }000077500000000000000000000000001211072747000416105ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/settingsPkgConfigExternalSettingProvider.java000066400000000000000000000300451211072747000511000ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/settings/******************************************************************************* * Copyright (c) 2011, 2012 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.settings; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.settings.model.CExternalSetting; import org.eclipse.cdt.core.settings.model.CIncludePathEntry; import org.eclipse.cdt.core.settings.model.CLibraryFileEntry; import org.eclipse.cdt.core.settings.model.CLibraryPathEntry; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICFolderDescription; import org.eclipse.cdt.core.settings.model.ICIncludePathEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSetting; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.extension.CExternalSettingProvider; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.cdt.managedbuilder.pkgconfig.util.Parser; import org.eclipse.cdt.managedbuilder.pkgconfig.util.PathToToolOption; import org.eclipse.cdt.managedbuilder.pkgconfig.util.PkgConfigUtil; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; /** * TODO: formOtherFlagEntries Bug 349791 */ public class PkgConfigExternalSettingProvider extends CExternalSettingProvider { public static final String ID = "org.eclipse.cdt.managedbuilder.pkgconfig.extSettings"; //$NON-NLS-1$ private final static String PACKAGES = "packages"; //$NON-NLS-1$ @Override public CExternalSetting[] getSettings(IProject proj, ICConfigurationDescription cfg) { if (proj != null) { ICSettingEntry[] includes = getEntries(proj, ICSettingEntry.INCLUDE_PATH); ICSettingEntry[] libFiles = getEntries(proj, ICSettingEntry.LIBRARY_FILE); ICSettingEntry[] libPaths = getEntries(proj, ICSettingEntry.LIBRARY_PATH); CExternalSetting includeSettings = new CExternalSetting( null, new String[] { "org.eclipse.cdt.core.cSource", "org.eclipse.cdt.core.cxxSource" }, null, includes); //$NON-NLS-1$ //$NON-NLS-2$ CExternalSetting libraryFileSettings = new CExternalSetting( null, new String[] { "org.eclipse.cdt.managedbuilder.core.compiledObjectFile" }, null, libFiles); //$NON-NLS-1$ CExternalSetting libraryPathSettings = new CExternalSetting( null, new String[] { "org.eclipse.cdt.managedbuilder.core.compiledObjectFile" }, null, libPaths); //$NON-NLS-1$ addOtherFlagsToTools(proj); return new CExternalSetting[] { includeSettings, libraryFileSettings, libraryPathSettings }; } return new CExternalSetting[] {}; } /** * Get language setting entries for given ICSettingEntry. * * @param proj * @param settingEntry * @return */ private static ICLanguageSettingEntry[] getEntries(IProject proj, int settingEntry) { String[] values = null; ICLanguageSettingEntry[] newEntries = null; ICLanguageSetting lang = getGCCLanguageSetting(proj); if (lang != null) { switch (settingEntry) { case ICSettingEntry.INCLUDE_PATH: values = getIncludePathsFromCheckedPackages(proj); newEntries = formIncludePathEntries(values); lang.setSettingEntries(ICSettingEntry.INCLUDE_PATH, newEntries); break; case ICSettingEntry.LIBRARY_FILE: values = getLibraryFilesFromCheckedPackages(proj); newEntries = formLibraryFileEntries(values); lang.setSettingEntries(ICSettingEntry.LIBRARY_FILE, newEntries); break; case ICSettingEntry.LIBRARY_PATH: values = getLibraryPathsFromCheckedPackages(proj); newEntries = formLibraryPathEntries(values); lang.setSettingEntries(ICSettingEntry.LIBRARY_PATH, newEntries); break; default: break; } } return newEntries; } /** * Get language settings for given project and language id. * * @param proj * @param languageId * @return */ private static ICLanguageSetting getLanguageSetting(IProject proj, String languageId) { ICLanguageSetting[] langSettings = getLanguageSettings(proj); ICLanguageSetting lang = null; for (ICLanguageSetting langSetting : langSettings) { String id = langSetting.getLanguageId(); if (id != null) { if (id.equalsIgnoreCase(languageId)) { lang = langSetting; return lang; } } } return null; } /** * Get language settings for the given project. * * @param proj * @return */ private static ICLanguageSetting[] getLanguageSettings(IProject proj) { ICProjectDescription projectDescription = CoreModel.getDefault() .getProjectDescription(proj); ICConfigurationDescription activeConf = projectDescription .getActiveConfiguration(); ICFolderDescription folderDesc = activeConf.getRootFolderDescription(); ICLanguageSetting[] langSettings = folderDesc.getLanguageSettings(); return langSettings; } /** * Get language settings for C projects. * * @param proj * @return */ private static ICLanguageSetting getGCCLanguageSetting(IProject proj) { return getLanguageSetting(proj, "org.eclipse.cdt.core.gcc"); //$NON-NLS-1$ } /** * Form ICIncludePathEntry array from include path String array. * * @param includes * @return */ private static ICLanguageSettingEntry[] formIncludePathEntries( String[] includes) { List incPathEntries = new ArrayList(); for (String inc : includes) { ICIncludePathEntry incPathEntry = new CIncludePathEntry(new Path( inc), ICSettingEntry.INCLUDE_PATH); incPathEntries.add(incPathEntry); } return incPathEntries.toArray(new ICLanguageSettingEntry[incPathEntries .size()]); } /** * Form CLibraryFileEntry array from library file String array. * * @param libs * @return */ private static ICLanguageSettingEntry[] formLibraryFileEntries(String[] libs) { List libEntries = new ArrayList(); for (String lib : libs) { CLibraryFileEntry libFileEntry = new CLibraryFileEntry(lib, ICSettingEntry.LIBRARY_FILE); libEntries.add(libFileEntry); } return libEntries .toArray(new ICLanguageSettingEntry[libEntries.size()]); } /** * Form CLibraryPathEntry array from library path String array. * * @param libPaths * @return */ private static ICLanguageSettingEntry[] formLibraryPathEntries( String[] libPaths) { List libPathEntries = new ArrayList(); for (String libPath : libPaths) { CLibraryPathEntry libPathEntry = new CLibraryPathEntry(new Path( libPath), ICSettingEntry.LIBRARY_PATH); libPathEntries.add(libPathEntry); } return libPathEntries.toArray(new ICLanguageSettingEntry[libPathEntries .size()]); } /** * Get include paths from the checked packages. * * @param proj * @return */ private static String[] getIncludePathsFromCheckedPackages(IProject proj) { List includeList = new ArrayList(); String[] pkgs = getCheckedPackageNames(proj); String cflags = null; String[] includeArray = null; for (String pkg : pkgs) { cflags = PkgConfigUtil.getCflags(pkg, proj.getName()); includeArray = Parser.parseIncPaths(cflags); if (includeArray != null) { Collections.addAll(includeList, includeArray); } } return includeList.toArray(new String[includeList.size()]); } /** * Get library files from the checked packages. * * @param proj * @return */ private static String[] getLibraryFilesFromCheckedPackages(IProject proj) { List libList = new ArrayList(); String[] pkgs = getCheckedPackageNames(proj); String libs = null; String[] libArray = null; for (String pkg : pkgs) { libs = PkgConfigUtil.getLibFilesOnly(pkg, proj.getName()); libArray = Parser.parseLibs2(libs); if (libArray != null) { Collections.addAll(libList, libArray); } } return libList.toArray(new String[libList.size()]); } /** * Get library paths from the checked packages. * * @param proj * @return */ private static String[] getLibraryPathsFromCheckedPackages(IProject proj) { List libPathList = new ArrayList(); String[] pkgs = getCheckedPackageNames(proj); String libPaths = null; String[] libPathArray = null; for (String pkg : pkgs) { libPaths = PkgConfigUtil.getLibPathsOnly(pkg, proj.getName()); libPathArray = Parser.parseLibPaths2(libPaths); if (libPathArray != null) { Collections.addAll(libPathList, libPathArray); } } return libPathList.toArray(new String[libPathList.size()]); } /** * Get other flags from the checked packages. * * @param proj * @return */ static String[] getOtherFlagsFromCheckedPackages(IProject proj) { List otherFlagList = new ArrayList(); String[] pkgs = getCheckedPackageNames(proj); String cflags = null; String[] otherFlagArray = null; for (String pkg : pkgs) { cflags = PkgConfigUtil.getCflags(proj.getName(), pkg); otherFlagArray = Parser.parseCflagOptions(cflags); if (otherFlagArray != null) { Collections.addAll(otherFlagList, otherFlagArray); } } return otherFlagList.toArray(new String[otherFlagList.size()]); } /** * Add other flags to Tool's Option. * * @param proj */ private static void addOtherFlagsToTools(final IProject proj) { Job j = new Job("Add other flags") { //$NON-NLS-1$ @Override protected IStatus run(IProgressMonitor monitor) { String[] flags = getOtherFlagsFromCheckedPackages(proj); for (String flag : flags) { PathToToolOption.addOtherFlag(flag, proj); } return Status.OK_STATUS; } }; j.setPriority(Job.INTERACTIVE); j.schedule(); } /** * Get a storage element which stores the checked packages. * * @param proj * @return */ private static ICStorageElement getPackageStorage(IProject proj) { try { ICProjectDescription projectDescription = CoreModel.getDefault() .getProjectDescription(proj); ICConfigurationDescription activeConf = projectDescription .getActiveConfiguration(); ICConfigurationDescription desc = activeConf.getConfiguration(); ICStorageElement strgElem = null; try { strgElem = desc.getStorage(PACKAGES, true); return strgElem; } catch (CoreException e) { Activator.getDefault().log(e, "Getting packages from the storage failed."); //$NON-NLS-1$ } } catch (NullPointerException e) { Activator.getDefault() .log(e, "Getting project description failed."); //$NON-NLS-1$ } return null; } /** * Get names of the checked packages. * * @param proj * @return */ private static String[] getCheckedPackageNames(IProject proj) { ICStorageElement pkgStorage = getPackageStorage(proj); String[] pkgNames = pkgStorage.getAttributeNames(); List pkgs = new ArrayList(); String value = null; for (String pkgName : pkgNames) { value = pkgStorage.getAttribute(pkgName); if (value != null) { if (value.equals("true")) { //$NON-NLS-1$ /* * replace + symbols, because + symbols in package names had * to be replaced when storing them to ICStorageElement to * prevent error */ if (pkgName.contains("plus")) { //$NON-NLS-1$ pkgName = pkgName.replace("plus", "+"); //$NON-NLS-1$ //$NON-NLS-2$ } pkgs.add(pkgName); } } } return pkgs.toArray(new String[pkgs.size()]); } } 000077500000000000000000000000001211072747000407255ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/utilArrayUtil.java000066400000000000000000000043341211072747000435100ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/util/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.util; import java.util.ArrayList; import java.util.List; public class ArrayUtil { /** * Split paths to a String array. * * @param str String of paths separated by a path separator. * @return String array containing multiple paths. */ public static String[] stringToArray(String str) { return str.split(Separators.getPathSeparator()); } /** * Append an array of Strings to a String separated by a path separator. * * @param array An array of Strings. * @return string which contains all indexes of * a String array separated by a path separator. */ public static String arrayToString(String[] array) { StringBuffer sB = new StringBuffer(); //if array isn't empty and doesn't contain an empty String if (array.length>0 /*&& !array[0].equals("")*/) { for (String i : array) { sB.append(i); sB.append(Separators.getPathSeparator()); } } return sB.toString(); } /** * Removes one path from the list of paths. * * @param existingPaths Existing list of paths to remove from * @param removePath Path to be removed. * @return String[] List that includes existing paths without the path that was removed. */ public static String[] removePathFromExistingPathList(String[] existingPaths, String removePath) { List newPathList = new ArrayList(); String path; //adds existing paths to new paths list for (int i = 0; i < existingPaths.length; i++) { path = existingPaths[i]; newPathList.add(path); } newPathList.remove(removePath); //creates a new list that includes all existing paths except the removed path String[] newArray = newPathList.toArray(new String[0]); return newArray; } } OSDetector.java000066400000000000000000000022441211072747000436050ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/util/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.util; /** * Detects the operating system of the machine. * */ public class OSDetector { public static boolean isUnix() { String os = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ return (os.indexOf("nix") >=0 || os.indexOf("nux") >=0); //$NON-NLS-1$ //$NON-NLS-2$ } public static boolean isWindows() { String os = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ return (os.indexOf("win") >= 0); //$NON-NLS-1$ } public static boolean isMac() { String os = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ return (os.indexOf("mac") >= 0); //$NON-NLS-1$ } }Parser.java000066400000000000000000000142711211072747000430310ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/util/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.util; import java.util.ArrayList; import java.util.List; /** * Parses pkg-config utility output. * */ public class Parser { /** * Parses options from "pkg-config --cflags" input. * * @param s Output from pkg-config. * @return Parsed String array. */ public static String[] parseCflagOptions(String s) throws NullPointerException { if (s != null) { String str; //find the index where include list starts int end = s.indexOf("-I"); //$NON-NLS-1$ if (end != -1) { //includes found if (end != 0) { //options found //truncate include paths str = s.substring(0, end-1); //insert options to an array String[] options = str.split(" "); //$NON-NLS-1$ return options; } else if (end == 0) { //no options found return null; } } else { //if no includes found //check if any flags found int flagStart = s.indexOf("-"); //$NON-NLS-1$ if (flagStart != -1) { //options found str = s.substring(flagStart, s.length()-1); //insert options into an array String[] options = str.split(" "); //$NON-NLS-1$ return options; } return null; } } //should not reach here return null; } /** * Parses include paths from "pkg-config --cflags" input. * * @param s Output from pkg-config. * @return Parsed String array. */ public static String[] parseIncPaths(String s) throws NullPointerException { if (s != null) { String str; //find the index where include list starts int start = s.indexOf("-I"); //$NON-NLS-1$ if (start != -1) { //if include paths found //truncate other than include paths str = s.substring(start, s.length()-1); //remove library search path flags str = str.replace("-I", ""); //$NON-NLS-1$ //$NON-NLS-2$ //insert include paths into an array String[] incPaths = str.split(" "); //$NON-NLS-1$ return incPaths; } return null; } return null; } // /** // * Parses library search paths from "pkg-config --libs" input. // * // * @param s Output from pkg-config. // * @return Parsed String array. // */ // public static String[] parseLibPaths(String s) throws NullPointerException { // //find the index where library path list starts // int start = s.indexOf("-L"); //$NON-NLS-1$ // String str; // if (start != -1) { //if library paths found // //find the index where library list starts // int end = s.indexOf(" -l"); //$NON-NLS-1$ // //truncate other than library paths // str = s.substring(start, end); // //remove library search path flags // str = str.replace("-L", ""); //$NON-NLS-1$ //$NON-NLS-2$ // //insert lib paths into an array // String[] libPaths = str.split(" "); //$NON-NLS-1$ // return libPaths; // } // return null; // } /** * Parses library search paths from "pkg-config --libs-only-L" input. * * @param s Output from pkg-config. * @return Parsed String array. */ public static String[] parseLibPaths2(String s) throws NullPointerException{ if (s != null) { //remove library search path flags String s2 = s.replace("-L", ""); //$NON-NLS-1$ //$NON-NLS-2$ //insert lib paths into an array String[] libPaths = s2.split(" "); //$NON-NLS-1$ return libPaths; } return null; } // /** // * Parses libraries from "pkg-config --libs" input. // * // * @param s Output from pkg-config. // * @return Parsed String array. // */ // public static String[] parseLibs(String s) throws NullPointerException { // if (s != null) { // String str; // //special case if pkg-config --libs output starts with -l // int start = s.indexOf("-l"); //$NON-NLS-1$ // if (start != 0) { // start = s.indexOf(" -l"); //$NON-NLS-1$ // } // if (start != -1) { //if libraries found // //truncate library search paths // str = s.substring(start+1, s.length()-1); // //remove lib flags // str = str.replace(" -l", " "); //$NON-NLS-1$ //$NON-NLS-2$ // //insert libs into an array // String[] libs = str.split(" "); //$NON-NLS-1$ // return libs; // } // return null; // } // return null; // } /** * Parses libraries from "pkg-config --libs-only-l" input. * * @param s Output from pkg-config. * @return Parsed String array. */ public static String[] parseLibs2(String s) throws NullPointerException { if (s != null) { String libStr = s; if(libStr.startsWith("-l")) { //$NON-NLS-1$ libStr = libStr.replaceFirst("-l", ""); //$NON-NLS-1$ //$NON-NLS-2$ //libStr = libStr.substring(2, libStr.length()-1); } //remove lib flags libStr = libStr.replace(" -l", " "); //$NON-NLS-1$ //$NON-NLS-2$ //insert libs into an array String[] libs = libStr.split(" "); //$NON-NLS-1$ return libs; } return null; } /** * Parse package list so that only package names are added to List. * * @param packages * @return */ public static List parsePackageList(List packages) { List operated = new ArrayList(); for (String s : packages) { //cut the string after the first white space int end = s.indexOf(" "); //$NON-NLS-1$ operated.add(s.substring(0, end)); } return operated; } /** * Parse package list that only package descriptions are added to List. * * @param packages * @return */ public static List parseDescription(List packages) { List operated = new ArrayList(); int ws, start = 0; for (String s : packages) { ws = s.indexOf(" "); //$NON-NLS-1$ //read as many characters forward that non white space is found find: for (int i=1; i+ws0)) { IConfiguration cf = getActiveBuildConf(proj); if (cf != null) { //Add path to compiler's Other flags Option addOtherFlagToToolOption(cf, otherFlag); } } } /** * Adds an other flag to compiler's Other flags Option. * * @param cf IConfiguration Build configuration * @param otherFlag Other flag * @return boolean Returns true if Other flags Option was added successfully to the compiler. */ private static boolean addOtherFlagToToolOption(IConfiguration cf, String otherFlag) { ITool compiler = getCompiler(cf); //If the compiler is found from the given build configuration if (compiler != null) { //get compiler's Other flags option IOption otherFlagOption = getCompilerOtherFlagsOption(cf); if (otherFlagOption != null) { //add other flag to compiler's Other flags Option type boolean val = addOtherFlagToToolOption(cf, compiler, otherFlagOption, otherFlag); return val; } return false; } //adding the other flag failed return false; } /** * Adds new other flag to the Compiler's Other flags Option. * * @param cf IConfiguration Build configuration * @param cfTool ITool Tool * @param option Tool Option type * @param newOtherFlag * @since 8.0 */ private static boolean addOtherFlagToToolOption(IConfiguration cf, ITool cfTool, IOption option, String newOtherFlag) { String flags = option.getValue().toString(); if (flags == null) { flags = ""; //$NON-NLS-1$ } if (!flags.contains(newOtherFlag)) { //append the new flag to existing flags flags = flags+" "+newOtherFlag; //$NON-NLS-1$ //add a new other flag to compiler's other flags option. ManagedBuildManager.setOption(cf, cfTool, option, flags); } else { return false; } return false; } /** * Return compiler according to the input type. * @param cf IConfiguration Build configuration * @return ITool Compiler */ private static ITool getCompiler(IConfiguration cf) { //get compiler according to the input type for(int i=0; i newPathList = new ArrayList(); String path; //adds existing paths to new paths list for (int i = 0; i < existingPaths.length; i++) { path = existingPaths[i]; newPathList.add(path); } //separates new path if it has multiple paths separated by a path separator String[] newPathArray = newPath.split(Separators.getPathSeparator()); for (int i = 0; i < newPathArray.length; i++) { path = newPathArray[i]; newPathList.add(path); } //creates a new list that includes all existing paths as well as new paths String[] newArray = newPathList.toArray(new String[0]); return newArray; } /** * Get the active build configuration. * * @param proj IProject * @return IConfiguration */ public static IConfiguration getActiveBuildConf(IProject proj) { IConfiguration conf = null; IManagedBuildInfo info = null; //try to get Managed build info try { info = ManagedBuildManager.getBuildInfo(proj); //null if doesn't exists } catch (Exception e) { //if not a managed build project Activator.getDefault().log(IStatus.INFO, e, "Not a managed build project."); //$NON-NLS-1$ return conf; } //info can be null for projects without build info. For example, when creating a project //from Import -> C/C++ Executable if(info == null) { return conf; } conf = info.getDefaultConfiguration(); return conf; } } PkgConfigUtil.java000066400000000000000000000173041211072747000443020ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/util/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.util; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import org.eclipse.cdt.managedbuilder.pkgconfig.Activator; import org.eclipse.cdt.managedbuilder.pkgconfig.preferences.PreferenceStore; /** * Runs pkg-config utility in the command line and outputs necessary options to * build the given package. * */ public class PkgConfigUtil { private static final String UNIX_PATH_SEPARATOR = ":"; //$NON-NLS-1$ private static final String WINDOWS_PATH_SEPARATOR = ";"; //$NON-NLS-1$ // Constant variables private static final String PKG_CONFIG = "pkg-config"; //$NON-NLS-1$ private static final String LIST_PACKAGES = "--list-all"; //$NON-NLS-1$ private static final String OUTPUT_LIBS = "--libs"; //$NON-NLS-1$ private static final String OUTPUT_CFLAGS = "--cflags"; //$NON-NLS-1$ private static final String OUTPUT_ALL = "--cflags --libs"; //$NON-NLS-1$ private static final String OUTPUT_ONLY_LIB_PATHS = "--libs-only-L"; //$NON-NLS-1$ private static final String OUTPUT_ONLY_LIB_FILES = "--libs-only-l"; //$NON-NLS-1$ /** * Get options needed to build the given package. Does not like spaces on * paths except that getAllPackages seem to work. * * @param pkgConfigOptions * Pkg-config options * @param pkg * @return */ private static String getPkgOutput(String project, String pkgConfigOptions) { List pkgOutputs = getPkgOutputs(project, pkgConfigOptions); if (pkgOutputs.isEmpty()) return null; return pkgOutputs.get(0); } /** * Get options needed to build the given package. Does not like spaces on * paths except that getAllPackages seem to work. * * @param pkgconfigOptions * Pkg-config options as --list-all, --libs... * @param project * Project name * @return pkg-config command results as a list of string */ private static List getPkgOutputs(String project, String pkgconfigOptions) { ProcessBuilder pb = null; String pkgConfigBinPath = PreferenceStore.getPkgConfigBinPath(project); if (pkgConfigBinPath.isEmpty()) { if (OSDetector.isWindows()) pkgConfigBinPath = PKG_CONFIG + ".exe"; //$NON-NLS-1$ else pkgConfigBinPath = PKG_CONFIG; } String[] pkgConfigPaths = PreferenceStore.getPkgConfigPath(project); StringBuffer pkgConfigCmd = new StringBuffer(); String pkgConfigPath = ""; //$NON-NLS-1$ if (pkgConfigPaths != null) { for (int i = 0; i < pkgConfigPaths.length; i++) { String pkgConfigPathValue = pkgConfigPaths[i]; pkgConfigPath += pkgConfigPathValue; if (i != pkgConfigPaths.length - 1) { if (OSDetector.isWindows()) { pkgConfigPath += WINDOWS_PATH_SEPARATOR; } else { pkgConfigPath += UNIX_PATH_SEPARATOR; } } } if (!pkgConfigPath.isEmpty()) { pkgConfigPath = pkgConfigPath.replace(" ", "\\ "); //$NON-NLS-1$ //$NON-NLS-2$ if (OSDetector.isWindows()) { pkgConfigCmd .append(" set PKG_CONFIG_PATH=" + pkgConfigPath + "&");//$NON-NLS-1$ //$NON-NLS-2$ } else { pkgConfigCmd .append(" PKG_CONFIG_PATH=" + pkgConfigPath + " ");//$NON-NLS-1$ //$NON-NLS-2$ } } } String[] pkgConfigLibDirPaths = PreferenceStore .getPkgConfigLibDir(project); if (pkgConfigLibDirPaths != null) { String pkgConfigLibDirPath = ""; //$NON-NLS-1$ for (int i = 0; i < pkgConfigLibDirPaths.length; i++) { String pkgConfigPathValue = pkgConfigLibDirPaths[i]; pkgConfigLibDirPath += pkgConfigPathValue; if (pkgConfigPaths != null && i != pkgConfigPaths.length - 1) { if (OSDetector.isWindows()) { pkgConfigPath += WINDOWS_PATH_SEPARATOR; } else { pkgConfigPath += UNIX_PATH_SEPARATOR; } } } if (!pkgConfigLibDirPath.isEmpty()) { pkgConfigLibDirPath = pkgConfigLibDirPath.replace(" ", "\\ "); //$NON-NLS-1$ //$NON-NLS-2$ if (OSDetector.isWindows()) { pkgConfigCmd .append(" set PKG_CONFIG_LIBDIR=" + pkgConfigLibDirPath + "&");//$NON-NLS-1$ //$NON-NLS-2$ } else { pkgConfigCmd .append(" PKG_CONFIG_LIBDIR=" + pkgConfigLibDirPath + " ");//$NON-NLS-1$ //$NON-NLS-2$ } } } pkgConfigCmd.append(pkgConfigBinPath); if (pkgconfigOptions != null && !pkgconfigOptions.isEmpty()) pkgConfigCmd.append(" " + pkgconfigOptions);//$NON-NLS-1$ if (OSDetector.isWindows()) { // For Windows the command should look like : // cmd /c 'PKG_CONFIG_PATH=/path/to/something pkg-config // --list-all' pb = new ProcessBuilder("cmd", "/c", pkgConfigCmd.toString()); //$NON-NLS-1$ //$NON-NLS-2$ } else { // For Unix/Mac the command should look like : // bash -c 'PKG_CONFIG_PATH=/path/to/something pkg-config // --list-all' pb = new ProcessBuilder("bash", "-c", pkgConfigCmd.toString()); //$NON-NLS-1$ //$NON-NLS-2$ } return runCommand(pb); } /** * Run the process and get the results as string array. * * @param pb * Process builder * @return Array of process results */ private static List runCommand(ProcessBuilder pb) { List results = new ArrayList(); try { Process p = pb.start(); String line; BufferedReader input = new BufferedReader(new InputStreamReader( p.getInputStream())); do { line = input.readLine(); if (line != null) { results.add(line); } } while (line != null); input.close(); } catch (IOException e) { Activator .getDefault() .log(e, "Starting a process (executing a command line script) failed."); //$NON-NLS-1$ } return results; } /** * Get cflags and libraries needed to build the given package. * * @param pkg Package * @param project Project name * @return */ public static String getAll(String pkg, String project) { return getPkgOutput(project, OUTPUT_ALL + " " + pkg); //$NON-NLS-1$ } /** * Get libraries (files and paths) needed to build the given package. * * @param pkg Package * @param project Project name * @return */ public static String getLibs(String pkg, String project) { return getPkgOutput(project, OUTPUT_LIBS + " " + pkg); //$NON-NLS-1$ } /** * Get library paths needed to build the given package. * * @param pkg Package * @param project Project name * @return */ public static String getLibPathsOnly(String pkg, String project) { return getPkgOutput(project, OUTPUT_ONLY_LIB_PATHS + " " + pkg); //$NON-NLS-1$ } /** * Get library files needed to build the given package. * * @param pkg Package * @param project Project name * @return */ public static String getLibFilesOnly(String pkg, String project) { return getPkgOutput(project, OUTPUT_ONLY_LIB_FILES + " " + pkg); //$NON-NLS-1$ } /** * Get cflags needed to build the given package. * * @param pkg Package * @param project Project name * @return */ public static String getCflags(String pkg, String project) { return getPkgOutput(project, OUTPUT_CFLAGS + " " + pkg); //$NON-NLS-1$ } /** * Get all packages that pkg-config utility finds (package name with * description). * * @param project * * @return */ public static List getAllPackages(String project) { return getPkgOutputs(project, LIST_PACKAGES); } } Separators.java000066400000000000000000000022071211072747000437140ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/src/org/eclipse/cdt/managedbuilder/pkgconfig/util/******************************************************************************* * Copyright (c) 2011 Petri Tuononen and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Petri Tuononen - Initial implementation *******************************************************************************/ package org.eclipse.cdt.managedbuilder.pkgconfig.util; /** * Provides different separators such as file and path separators. * */ public class Separators { private static final String pathSeparator = System.getProperty("path.separator"); //$NON-NLS-1$ private static final String fileSeparator = System.getProperty("file.separator"); //$NON-NLS-1$ /** * Get path separator. * * @return path separator */ public static String getPathSeparator() { return pathSeparator; } /** * Get file separator. * * @return file separator */ public static String getFileSeparator() { return fileSeparator; } } eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/000077500000000000000000000000001211072747000313375ustar00rootroot00000000000000000077500000000000000000000000001211072747000346455ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates000077500000000000000000000000001211072747000406705ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGTK+Project000077500000000000000000000000001211072747000414575ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGTK+Project/srcBasename.c000066400000000000000000000024111211072747000433340ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGTK+Project/src/* ============================================================================ Name : $(baseName).c Author : $(author) Version : Copyright : $(copyright) Description : Hello World in GTK+ ============================================================================ */ #include int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *label; gtk_init (&argc, &argv); /* create the main, top level, window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* give it the title */ gtk_window_set_title (GTK_WINDOW (window), "Hello World"); /* Connect the destroy signal of the window to gtk_main_quit * When the window is about to be destroyed we get a notification and * stop the main GTK+ loop */ g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); /* Create the "Hello, World" label */ label = gtk_label_new ("Hello, World"); /* and insert it into the main window */ gtk_container_add (GTK_CONTAINER (window), label); /* make sure that everything, window and label, are visible */ gtk_widget_show_all (window); /* start the main loop, and let it rest there until the application is closed */ gtk_main (); return 0; } template.properties000066400000000000000000000026441211072747000446270ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGTK+Project############################################################################### # Copyright (c) 2007, 2011 Symbian Software Private Ltd. and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Bala Torati (Symbian) - initial API and implementation # Petri Tuononen - Modification for GTK+ ############################################################################### #Template Default Values HelloWorld.GTK+template.label=Hello World GTK+ Project HelloWorld.GTK+template.description=A skeletal Managed GTk+ Hello World project. Creates a folder for sources and another for include. HelloWorld.basics.label=Basic Settings HelloWorld.basics.description=Basic properties of a project HelloWorld.author.label=Author HelloWorld.author.description=Name of the author HelloWorld.copyright.label=Copyright notice HelloWorld.copyright.description=Your copyright notice HelloWorld.copyright.default=Your copyright notice HelloWorld.message.default=!!!Hello World!!! HelloWorld.message.description=Your hello world greeting message HelloWorld.message.label=Hello world greeting HelloWorld.sourceDir.label=Source HelloWorld.sourceDir.description=Directory for hello world project source files HelloWorld.sourceDir.default=src template.xml000066400000000000000000000051761211072747000432360ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGTK+Project 000077500000000000000000000000001211072747000412475ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject000077500000000000000000000000001211072747000420365ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject/srcHelloWorld.cpp000066400000000000000000000017661211072747000446270ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject/src/* ============================================================================ Name : $(baseName).cpp Author : $(author) Version : Copyright : $(copyright) Description : Hello World in gtkmm ============================================================================ */ #include "HelloWorld.h" #include HelloWorld::HelloWorld() : m_button("Hello World") // creates a new button with label "Hello World". { // Sets the border width of the window. set_border_width(10); // When the button receives the "clicked" signal, it will call the // on_button_clicked() method defined below. m_button.signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::on_button_clicked)); // This packs the button into the Window (a container). add(m_button); // The final step is to display this newly created widget... m_button.show(); } HelloWorld::~HelloWorld() { } void HelloWorld::on_button_clicked() { std::cout << "Hello World" << std::endl; } HelloWorld.h000066400000000000000000000005511211072747000442630ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject/src#ifndef GTKMM_EXAMPLE_HELLOWORLD_H #define GTKMM_EXAMPLE_HELLOWORLD_H #include #include class HelloWorld : public Gtk::Window { public: HelloWorld(); virtual ~HelloWorld(); protected: //Signal handlers: void on_button_clicked(); //Member widgets: Gtk::Button m_button; }; #endif // GTKMM_EXAMPLE_HELLOWORLD_H Main.cpp000066400000000000000000000010311211072747000434210ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject/src/* ============================================================================ Name : $(baseName).cpp Author : $(author) Version : Copyright : $(copyright) Description : Hello World in gttkmm ============================================================================ */ #include "HelloWorld.h" #include int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); HelloWorld helloworld; //Shows the window and returns when it is closed. Gtk::Main::run(helloworld); return 0; } template.properties000066400000000000000000000026501211072747000452030ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject############################################################################### # Copyright (c) 2007, 2011 Symbian Software Private Ltd. and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Bala Torati (Symbian) - initial API and implementation # Petri Tuononen - Modification for GTK+ ############################################################################### #Template Default Values HelloWorld.Gtkmmtemplate.label=Hello World Gtkmm Project HelloWorld.Gtkmmtemplate.description=A skeletal Managed Gtkmm Hello World project. Creates a folder for sources and another for include. HelloWorld.basics.label=Basic Settings HelloWorld.basics.description=Basic properties of a project HelloWorld.author.label=Author HelloWorld.author.description=Name of the author HelloWorld.copyright.label=Copyright notice HelloWorld.copyright.description=Your copyright notice HelloWorld.copyright.default=Your copyright notice HelloWorld.message.default=!!!Hello World!!! HelloWorld.message.description=Your hello world greeting message HelloWorld.message.label=Hello world greeting HelloWorld.sourceDir.label=Source HelloWorld.sourceDir.description=Directory for hello world project source files HelloWorld.sourceDir.default=src template.xml000066400000000000000000000057531211072747000436160ustar00rootroot00000000000000eclipse-cdt-pkg-config-1.0.0~git20130115/org.eclipse.cdt.managedbuilder.pkgconfig/templates/projecttemplates/HelloWorldGtkmmProject